k94314517
2024-05-27 ab0a9275c3bbd9ffa1a3f2147fcb1e409622cca8
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -39,6 +39,7 @@
import com.doumee.dao.web.reqeust.VisitRecordDTO;
import com.doumee.dao.web.response.VisitDetailVO;
import com.doumee.dao.web.response.VisitRecordVO;
import com.doumee.service.business.ApproveService;
import com.doumee.service.business.InterfaceLogService;
import com.doumee.service.business.SmsEmailService;
import com.doumee.service.business.VisitsService;
@@ -104,6 +105,8 @@
    private SmsEmailService smsEmailService;
    @Autowired
    private SystemUserMapper systemUserMapper;
    @Autowired
    private ApproveService approveService;
    @Override
@@ -199,7 +202,7 @@
        //检查是否必须答题,并且符合答题要求
        ProblemLog problemLog = isValidProblemLog(visits);
        //获取申请的海康访问门禁组信息
        getHkDeviceRoles(visits,isERP);
//        getHkDeviceRoles(visits,isERP);
        //检验拜访人是否合法
        Member visitMember = isValideVisitedUser(visits.getReceptMemberId());
        if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType())&&visits.getIdcardNo().length()!=18
@@ -237,6 +240,7 @@
        }else if(dataSyncConfig.getVisitorDataOrigin().equals(Constants.ZERO)){
            visits.setStatus(Constants.VisitStatus.pass);
            visitsMapper.updateById(visits);
            approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId());
        }else{
            throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,发起拜访审批申请失败!");
        }
@@ -490,7 +494,6 @@
                .eq(ApproveParam::getMemberType,Constants.ZERO)
                .last("limit 1"));
         return  Objects.isNull(approveParam)?null:approveParam.getId();
    }
@@ -613,13 +616,15 @@
        }
        //访客报备
        if(visits.getType().equals(Constants.TWO)
         && (StringUtils.isBlank( visits.getName())
            && (StringUtils.isBlank( visits.getName())
                ||  StringUtils.isBlank( visits.getPhone())
                ||  StringUtils.isBlank( visits.getCompanyName()))
                ||  StringUtils.isBlank( visits.getCarNos())
                ||  Objects.isNull( visits.getMemberNum())
        ){
            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()){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,入厂时间必须大于当前时间!");//
@@ -1210,7 +1215,7 @@
    @Override
    public VisitDetailVO getVisitDetail(Integer id){
    public VisitDetailVO getVisitDetail(Integer id,Integer memberId){
        Visits visits = visitsMapper.selectById(id);
        if(Objects.isNull(visits)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
@@ -1254,6 +1259,15 @@
                visitsMapper.selectList(new QueryWrapper<Visits>().lambda()
                .select(Visits::getName,Visits::getPhone,Visits::getQrcode,Visits::getFaceImg,Visits::getImgurl,Visits::getIdcardDecode,Visits::getStatus)
                .eq(Visits::getParentId,id)));
        if(Objects.nonNull(memberId)){
            visitDetailVO.setApproveDateVO(
                    approveService.arrangeApprovedData(id,
                            visits.getType(),
                            memberId)
            );
        }
        return visitDetailVO;
    }
@@ -1356,8 +1370,6 @@
        dto.setId(systemUser.getId());
        dto.setOperaUserId(systemUser.getId());
        systemUserBiz.resetPwd(dto);
    }
}