k94314517
2024-09-23 0178205be3ffce33af631658de35e3805641d5d3
代码初始化
已修改9个文件
216 ■■■■ 文件已修改
server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/RoomsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformWarnEventListResponse.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/SignInDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/BookingsServiceImpl.java
@@ -1133,7 +1133,7 @@
                    .eq(Bookings::getRoomId,bookings.getRoomId())
                    .ne(Bookings::getId,bookings.getId())
            )>Constants.ZERO){
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未开启会议,无法进行开始会议");
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未开启会议,无法开始会议");
            };
            if(bookingsMapper.selectCount(new QueryWrapper<Bookings>()
@@ -1144,11 +1144,11 @@
                    .eq(Bookings::getStatus,Constants.ZERO)
                    .eq(Bookings::getRoomId,bookings.getRoomId())
            )>Constants.ZERO){
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前开启时间与其他会议存在冲突,无法进行开始会议");
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前开启时间与其他会议存在冲突,无法开始会议");
            };
        }else{
            if(bookings.getStartTime().getTime() > System.currentTimeMillis()){
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未到会议申请开始时间,无法进行开始");
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未到会议申请开始时间,无法开始");
            }
        }
        bookings.setStartTimeReal(new Date());
server/meeting/meeting_service/src/main/java/com/doumee/service/business/impl/RoomsServiceImpl.java
@@ -370,7 +370,7 @@
        Integer re = recordisExist(rooms.getId());
        if (Constants.equalsInteger(re, Constants.ONE)) {
            //存下预约记录不允许更新开放时间和粒度分钟
           // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "会议室存在预约中的记录,不允许修改");
//            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "会议室存在预约中的记录,不允许修改");
            rooms.setStartTime(null);
            rooms.setEndTime(null);
            rooms.setIntervalTime(null);
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java
@@ -10,6 +10,7 @@
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.PlatformJob;
import com.doumee.dao.web.reqeust.JobDetailDTO;
import com.doumee.dao.web.reqeust.SignInDTO;
import com.doumee.service.business.PlatformJobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -89,4 +90,12 @@
    public ApiResponse<PlatformJob>  jobDetail (@RequestBody JobDetailDTO jobDetailDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        return ApiResponse.success(platformJobService.getDetail(jobDetailDTO));
    }
    @ApiOperation("任务签到")
    @PostMapping("/signIn")
    public ApiResponse  signIn (@RequestBody SignInDTO signInDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        signInDTO.setLoginUserInfo(getLoginUser(token));
        platformJobService.signIn(signInDTO);
        return ApiResponse.success("操作成功");
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
@@ -102,7 +102,6 @@
    @ApiModelProperty(value = "最后事件推送时间")
    @ExcelColumn(name="最后事件推送时间")
    private Date lastEventTime;
    @ApiModelProperty(value = "监控点名称,多个用英文逗号隔开")
@@ -158,10 +157,10 @@
    private String groupName;
    @ApiModelProperty(value = "关联LED编码集合,英文逗号隔开", example = "1")
    @TableField(exist = false)
    private String ledIds;
    private List<Integer> ledIds;
    @ApiModelProperty(value = "关联广播编码集合,英文逗号隔开", example = "1")
    @TableField(exist = false)
    private String broadcastIds;
    private List<Integer> broadcastIds;
    @ApiModelProperty(value = "关联LED名称集合,英文逗号隔开", example = "1")
    @TableField(exist = false)
    private String ledNames;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
@@ -95,8 +95,8 @@
    @ExcelColumn(name="签到时间")
    private Date signDate;
    @ApiModelProperty(value = "签到方式 0app签到 1扫码签到", example = "1")
    @ExcelColumn(name="签到方式 0app签到 1扫码签到")
    @ApiModelProperty(value = "签到方式 0app签到 1扫码签到 2后台签到", example = "1")
    @ExcelColumn(name="签到方式 0app签到 1扫码签到 2后台签到")
    private Integer singType;
    @ApiModelProperty(value = "通知WMS作业绑定月台时间")
    @ExcelColumn(name="通知WMS作业绑定月台时间")
server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformWarnEventListResponse.java
@@ -21,4 +21,8 @@
    private Date createDate;
    @ApiModelProperty(value = "事件内容说明")
    private String content;
    @ApiModelProperty(value = "月台名称")
    private String platformName;
    @ApiModelProperty(value = "月台编码")
    private String platfromHkId;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/SignInDTO.java
@@ -21,7 +21,7 @@
    @ApiModelProperty(value = "任务主键")
    private Integer jobId;
    @ApiModelProperty(value = "签到类型: 0=app签到 1=扫码签到")
    @ApiModelProperty(value = "签到类型: 0=app签到 1=扫码签到 2=后台签到")
    private Integer signType;
    @ApiModelProperty(value = "签到二维码值")
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -239,8 +239,8 @@
                .eq(pageWrap.getModel().getPlatformGroupId() != null, PlatformJob::getPlatformGroupId, pageWrap.getModel().getPlatformGroupId())
                .apply(pageWrap.getModel().getQueryStatus() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatus()+"')")
                .ge(pageWrap.getModel().getBeginWorkDateStart() != null, PlatformJob::getStartDate, Utils.Date.getStart(pageWrap.getModel().getBeginWorkDateStart()))
                .le(pageWrap.getModel().getBeginWorkDateEnd() != null, PlatformJob::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getBeginWorkDateEnd()))
                .ge(pageWrap.getModel().getBeginWorkDateStart() != null, PlatformJob::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getBeginWorkDateStart()))
                .le(pageWrap.getModel().getBeginWorkDateEnd() != null, PlatformJob::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getBeginWorkDateEnd()))
                .eq(pageWrap.getModel().getJobType() != null && Constants.equalsInteger(Constants.ONE,pageWrap.getModel().getJobType()), PlatformJob::getType, Constants.platformJobType.sgscxh)
                .ne(pageWrap.getModel().getJobType() != null && Constants.equalsInteger(Constants.ZERO,pageWrap.getModel().getJobType()), PlatformJob::getType, Constants.platformJobType.sgscxh)
        ;
@@ -373,7 +373,8 @@
            }else{
                platformJob.setWaitTime("等待叫号");
            }
        }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
        }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())
        || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){
            //查询最后开始任务的月台记录  日志表  因为存在异常挂起 转移 等问题
            PlatformLog platformLog = platformLogMapper.selectOne(new QueryWrapper<PlatformLog>().lambda()
                    .eq(PlatformLog::getJobId,platformJob.getId())
@@ -416,7 +417,7 @@
                .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                .eq(PlatformJob::getDrivierPhone,loginUserInfo.getMobile())
                .like(PlatformJob::getArriveDate,DateUtil.getCurrDate())
//                .like(PlatformJob::getArriveDate,DateUtil.getCurrDate())
                .orderByDesc(PlatformJob::getId)
        );
        for (PlatformJob platformJob:platformJobList) {
@@ -462,8 +463,9 @@
        PlatformJob oldPlatformJob = new PlatformJob();
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        platformJob.setConfirmTaskDate(new Date());
        platformJob.setArriveDate(confirmTaskDTO.getArriveDate());
        platformJob.setCarCodeBack(confirmTaskDTO.getCarCodeBack());
        platformJob.setStatus(Constants.PlatformJobStatus.WART_SIGN_IN.getKey());
        platformJob.setEditDate(new Date());
        platformJobMapper.updateById(platformJob);
@@ -488,19 +490,31 @@
        if(Objects.isNull(platformJob)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
        }
        PlatformJob oldPlatformJob = new PlatformJob();
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ZERO)){
            if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
            this.distanceSignIn(signInDTO,platformJob);
        }else if(Constants.equalsInteger(signInDTO.getSignType(),Constants.ONE)){
            if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
            this.sceneSignIn(signInDTO);
        }else if(Constants.equalsInteger(signInDTO.getSignType(),Constants.TWO)){
            if(!(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CONFIRM.getKey())||
                    Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey()))
            ){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转,请刷新查看");
            }
        }else{
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"签到类型错误");
        }
        platformJob.setSignDate(new Date());
        platformJob.setSingType(Constants.ZERO);
        platformJob.setSingType(signInDTO.getSignType());
        platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());
        platformJobMapper.updateById(platformJob);
        //存储操作日志
@@ -508,12 +522,12 @@
                Constants.PlatformJobLogType.SIGN.getInfo());
    }
    public void distanceSignIn(SignInDTO signInDTO , PlatformJob platformJob){
        if(Objects.isNull(signInDTO.getLat())
                || Objects.isNull(signInDTO.getLnt())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"经纬度信息异常");
        }
        //获取签到点的经纬度
        Double lat = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LAT).getCode());
        Double lnt = Double.parseDouble(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_PLACE_LNT).getCode());
@@ -529,6 +543,7 @@
    }
    public void sceneSignIn(SignInDTO signInDTO){
        if( StringUtils.isNotBlank(signInDTO.getQrCodeKey())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
@@ -716,6 +731,7 @@
        || Constants.equalsInteger(platformJob.getType(),Constants.FOUR)){
            //TODO 下发入园权限
        }
        //存储操作日志
        savePlatformLog(Constants.PlatformJobLogType.IN_WAIT.getKey(),oldPlatformJob,platformJob,
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
@@ -1,5 +1,6 @@
package com.doumee.service.business.impl;
import cn.emay.sdk.util.StringUtil;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
@@ -7,25 +8,27 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.DeviceMapper;
import com.doumee.dao.business.PlatformDeviceMapper;
import com.doumee.dao.business.PlatformMapper;
import com.doumee.dao.business.join.PlatformJoinMapper;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.business.model.PlatformGroup;
import com.doumee.dao.business.model.*;
import com.doumee.dao.openapi.response.PlatformNumByStatusResponse;
import com.doumee.service.business.PlatformDeviceService;
import com.doumee.service.business.PlatformService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -40,10 +43,62 @@
    private PlatformMapper platformMapper;
    @Autowired
    private PlatformJoinMapper platformJoinMapper;
    @Autowired
    private PlatformDeviceMapper platformDeviceMapper;
    @Autowired
    private DeviceMapper deviceMapper;
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public Integer create(Platform platform) {
        platform.setCreateDate(new Date());
        platform.setIsdeleted(Constants.ZERO);
        platform.setCreator(platform.getLoginUserInfo().getId());
        platformMapper.insert(platform);
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platform.getLedIds())){
            List<PlatformDevice> platformDeviceList = new ArrayList<>();
            for (Integer ledId:platform.getLedIds()) {
                Device device = deviceMapper.selectById(ledId);
                if(Objects.isNull(device)){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到led设备信息【"+ledId+"】");
                }
                PlatformDevice platformDevice = new PlatformDevice();
                platformDevice.setIsdeleted(Constants.ZERO);
                platformDevice.setPlatformId(platform.getId());
                platformDevice.setCreateDate(new Date());
                platformDevice.setCreator(platform.getLoginUserInfo().getId());
                platformDevice.setType(Constants.ZERO);
                platformDevice.setDeviceId(ledId.toString());
                platformDevice.setHkId(device.getHkId());
                platformDevice.setName(device.getName());
                platformDeviceList.add(platformDevice);
            }
            platformDeviceMapper.insert(platformDeviceList);
        }
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platform.getBroadcastIds())){
            List<PlatformDevice> platformDeviceList = new ArrayList<>();
            for (Integer broadcastId:platform.getBroadcastIds()) {
                Device device = deviceMapper.selectById(broadcastId);
                if(Objects.isNull(device)){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到广播设备信息【"+broadcastId+"】");
                }
                PlatformDevice platformDevice = new PlatformDevice();
                platformDevice.setIsdeleted(Constants.ZERO);
                platformDevice.setPlatformId(platform.getId());
                platformDevice.setCreateDate(new Date());
                platformDevice.setCreator(platform.getLoginUserInfo().getId());
                platformDevice.setType(Constants.TWO);
                platformDevice.setDeviceId(broadcastId.toString());
                platformDevice.setHkId(device.getHkId());
                platformDevice.setName(device.getName());
                platformDeviceList.add(platformDevice);
            }
            platformDeviceMapper.insert(platformDeviceList);
        }
        return platform.getId();
    }
@@ -67,7 +122,60 @@
    }
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public void updateById(Platform platform) {
        platform.setEditor(platform.getLoginUserInfo().getId());
        platform.setEditDate(new Date());
        //删除LED/广播数据
        platformDeviceMapper.delete(new QueryWrapper<PlatformDevice>().lambda()
                .eq(PlatformDevice::getPlatformId,platform.getId())
                .in(PlatformDevice::getType,Constants.ZERO,Constants.TWO)
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platform.getLedIds())){
            List<PlatformDevice> platformDeviceList = new ArrayList<>();
            String ledNames = "";
            for (Integer ledId:platform.getLedIds()) {
                Device device = deviceMapper.selectById(ledId);
                if(Objects.isNull(device)){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到led设备信息【"+ledId+"】");
                }
                PlatformDevice platformDevice = new PlatformDevice();
                platformDevice.setIsdeleted(Constants.ZERO);
                platformDevice.setPlatformId(platform.getId());
                platformDevice.setCreateDate(new Date());
                platformDevice.setCreator(platform.getLoginUserInfo().getId());
                platformDevice.setType(Constants.ZERO);
                platformDevice.setDeviceId(ledId.toString());
                platformDevice.setHkId(device.getHkId());
                platformDevice.setName(device.getName());
                platformDeviceList.add(platformDevice);
            }
            platformDeviceMapper.insert(platformDeviceList);
            platform.setLedNames(ledNames);
        }
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platform.getBroadcastIds())){
            List<PlatformDevice> platformDeviceList = new ArrayList<>();
            String ledNames = "";
            for (Integer broadcastId:platform.getBroadcastIds()) {
                Device device = deviceMapper.selectById(broadcastId);
                if(Objects.isNull(device)){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到广播设备信息【"+broadcastId+"】");
                }
                PlatformDevice platformDevice = new PlatformDevice();
                platformDevice.setIsdeleted(Constants.ZERO);
                platformDevice.setPlatformId(platform.getId());
                platformDevice.setCreateDate(new Date());
                platformDevice.setCreator(platform.getLoginUserInfo().getId());
                platformDevice.setType(Constants.TWO);
                platformDevice.setDeviceId(broadcastId.toString());
                platformDevice.setHkId(device.getHkId());
                platformDevice.setName(device.getName());
                platformDeviceList.add(platformDevice);
            }
            platformDeviceMapper.insert(platformDeviceList);
        }
        platformMapper.updateById(platform);
    }
@@ -160,7 +268,35 @@
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(platformMapper.selectJoinPage(page,Platform.class, queryWrapper));
        PageData<Platform> platformPageData = PageData.from(platformMapper.selectJoinPage(page,Platform.class, queryWrapper));
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformPageData.getRecords())){
            for (Platform platform:platformPageData.getRecords()) {
                List<PlatformDevice> ledDevice =  platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                        .eq(PlatformDevice::getPlatformId,platform.getId())
                        .eq(PlatformDevice::getType,Constants.ZERO)
                );
                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ledDevice)){
                    platform.setLedNames(String.join(",", ledDevice.stream().map(m->m.getName()).collect(Collectors.toList())));
                    platform.setLedIds(
                            ledDevice.stream().map(m->Integer.valueOf(m.getDeviceId())).collect(Collectors.toList())
                    );
                }
                List<PlatformDevice> broadcastDevice =  platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                        .eq(PlatformDevice::getPlatformId,platform.getId())
                        .eq(PlatformDevice::getType,Constants.TWO)
                );
                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(broadcastDevice)){
                    platform.setBroadcastNames(String.join(",", broadcastDevice.stream().map(m->m.getName()).collect(Collectors.toList())));
                    platform.setBroadcastIds(
                            broadcastDevice.stream().map(m->Integer.valueOf(m.getDeviceId())).collect(Collectors.toList())
                    );
                }
            }
        }
        return platformPageData;
    }
    @Override