| | |
| | | private final ApprovalEngineService approvalEngineService; |
| | | private final PostApprovalOrchestrationService postApprovalOrchestrationService; |
| | | private final ApprovalFlowViewApplicationService approvalFlowViewApplicationService; |
| | | private final SensitiveWordFilterService sensitiveWordFilterService; |
| | | private final IntegrationHikvisionService integrationHikvisionService; |
| | | private final ObjectMapper objectMapper; |
| | | private final ApplicationEventPublisher applicationEventPublisher; |
| | | |
| | |
| | | order.setVisitedUserName(StringUtils.hasText(visited.getNickName()) ? visited.getNickName() : "员工"); |
| | | order.setVisitedDeptId(visited.getDeptId()); |
| | | order.setVisitReasonCode(req.getVisitReasonCode().trim()); |
| | | order.setVisitReasonOther(trimToNull(req.getVisitReasonOther())); |
| | | order.setVisitReasonOther(sensitiveWordFilterService.filter(trimToNull(req.getVisitReasonOther()))); |
| | | order.setVisitorOrg(resolveVisitorOrg(visitorMap.values())); |
| | | order.setVisitTimeMode(mode); |
| | | order.setVisitTimeSlot( |
| | |
| | | if (!StringUtils.hasText(c)) { |
| | | throw new BizException(BizErrorCode.AUTH_INVALID_CREDENTIALS, "拜访事由不能为空"); |
| | | } |
| | | String txt = trimToNull(other); |
| | | if (!StringUtils.hasText(txt)) { |
| | | throw new BizException(BizErrorCode.AUTH_INVALID_CREDENTIALS, "请输入事由说明"); |
| | | } |
| | | if (txt.length() > 15) { |
| | | throw new BizException(BizErrorCode.AUTH_INVALID_CREDENTIALS, "事由说明不能超过15个字"); |
| | | } |
| | | if (AppointmentBizConstants.VISIT_REASON_OTHER.equalsIgnoreCase(c)) { |
| | | String txt = trimToNull(other); |
| | | if (!StringUtils.hasText(txt)) { |
| | | throw new BizException(BizErrorCode.AUTH_INVALID_CREDENTIALS, "选择其他时须填写自定义内容"); |
| | | } |
| | | if (txt.length() > 15) { |
| | | throw new BizException(BizErrorCode.AUTH_INVALID_CREDENTIALS, "自定义内容不能超过15字"); |
| | | } |
| | | return; |
| | | } |
| | | Long cnt = |
| | |
| | | } |
| | | |
| | | private String buildVisitReasonText(AppointmentOrder row, Map<String, String> reasonNameMap) { |
| | | if (AppointmentBizConstants.VISIT_REASON_OTHER.equalsIgnoreCase(trimToNull(row.getVisitReasonCode()))) { |
| | | String other = trimToNull(row.getVisitReasonOther()); |
| | | return StringUtils.hasText(other) ? "其他:" + other : "其他"; |
| | | } |
| | | String reasonName = reasonNameMap.get(trimToNull(row.getVisitReasonCode())); |
| | | return StringUtils.hasText(reasonName) ? reasonName : trimToNull(row.getVisitReasonCode()); |
| | | } |
| | |
| | | vo.setTicketId(ticket.getId()); |
| | | vo.setTicketUuid(ticket.getUuid()); |
| | | vo.setMpVisitorId(ticket.getMpVisitorId()); |
| | | vo.setPayload(ticket.getPayload()); |
| | | vo.setPayload(integrationHikvisionService.encryptQrcodePayload(ticket.getPayload())); |
| | | vo.setGenerateTime(ticket.getGenerateTime()); |
| | | vo.setExpireTime(ticket.getExpireTime()); |
| | | vo.setVisitorName(resolveVisitorName(ticket.getMpVisitorId(), orderVisitors, visitorMap)); |