jiangping
2024-10-10 02af384faaa0572008405037e6e8917c7ad22136
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
@@ -11,10 +11,7 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.ApproveTemplMapper;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.PlatformBooksMapper;
import com.doumee.dao.business.PlatformReasonMapper;
import com.doumee.dao.business.*;
import com.doumee.dao.business.join.ApproveJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ApproveDataVO;
@@ -63,6 +60,9 @@
    private PlatformReasonMapper platformReasonMapper;
    @Autowired
    private PlatformGroupMapper platformGroupMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
@@ -73,6 +73,9 @@
    @Autowired
    private ApproveJoinMapper approveJoinMapper;
    @Autowired
    private CarsMapper carsMapper;
    @Override
@@ -241,6 +244,17 @@
        if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"入园原因信息异常,请刷新重试");
        }
        PlatformGroup platformGroup= platformGroupMapper.selectById(platformReason.getGroupId());
        if(Objects.isNull(platformGroup)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到绑定月台组数据");
        }
        if(!Constants.equalsInteger(platformGroup.getIsdeleted(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"绑定月台组数据异常,请联系管理员");
        }
        //查询车辆是否为自有车
        if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]属于内部车辆,无法预约");
        };
        ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getId());
        if(Objects.isNull(approveTempl)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未配置审批流,请联系管理员");
@@ -282,6 +296,10 @@
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        //查询车辆是否为自有车
        if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]属于内部车辆,无法预约");
        };
        PlatformBooks platformBooks = platformBooksMapper.selectById(platformBooksApplyDTO.getId());
        if(Objects.isNull(platformBooks)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);