k94314517
2024-05-29 74c7d32b4339d241af18b33b3691dc912256306c
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -258,6 +258,7 @@
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public Integer visitReporting(Visits visits) {
        visits.setSourceType(Constants.ZERO);
        isValidBaseParam(visits);
        //检验被拜访人是否合法
        Member visitMember = isValideVisitedUser(visits.getMemberId());
@@ -271,7 +272,7 @@
        visits.setVisitType(Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_VISIT_REQUIRED).getCode()));
        visits.setIdcardNo(DESUtil.decrypt(Constants.EDS_PWD, visitMember.getIdcardNo()));
        //初始化访客信息
        initVisitInfo(visits,date);
//        initVisitInfo(visits,date);
        visitsMapper.insert(visits);
        return visits.getId();
    }
@@ -607,12 +608,17 @@
                ||  StringUtils.isBlank( visits.getName())
                ||  StringUtils.isBlank( visits.getPhone())
                ||  StringUtils.isBlank( visits.getCompanyName())
                ||  visits.getIdcardType() == null
                ||  Objects.isNull(visits.getType())
//                ||  StringUtils.isBlank( visits.getFaceImg() )
                ||  StringUtils.isBlank( visits.getIdcardNo() )
                || visits.getReceptMemberId() == null){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!");
        }
        if(Constants.equalsInteger(visits.getType(),Constants.ZERO)
             ||  Constants.equalsInteger(visits.getType(),Constants.ONE)){
            if(  visits.getIdcardType() == null
                    ||  StringUtils.isBlank( visits.getIdcardNo() ) ){
                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!");
            }
        }
        //访客报备
        if(visits.getType().equals(Constants.TWO)
@@ -620,10 +626,10 @@
                ||  StringUtils.isBlank( visits.getPhone())
                ||  StringUtils.isBlank( visits.getCompanyName()))
                ||  StringUtils.isBlank( visits.getCarNos())
                ||  Objects.isNull(visits.getReceptMemberId())
        ){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!");
        }else if(visits.getType().equals(Constants.ONE) && StringUtils.isBlank(visits.getConstructionReason())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未填写施工事由!");
        }
        if(visits.getEndtime().getTime() < System.currentTimeMillis()){