|
@@ -9,10 +9,7 @@ import com.github.microservice.net.ResultMessage;
|
|
|
import com.github.microservice.types.user.DevicePermissFromType;
|
|
import com.github.microservice.types.user.DevicePermissFromType;
|
|
|
import com.github.microservice.types.user.UserFromType;
|
|
import com.github.microservice.types.user.UserFromType;
|
|
|
import com.zhongshu.card.client.model.devices.DeviceInfoSimpleModel;
|
|
import com.zhongshu.card.client.model.devices.DeviceInfoSimpleModel;
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainModel;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainParam;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainSearch;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorReViewParam;
|
|
|
|
|
|
|
+import com.zhongshu.card.client.model.visitor.*;
|
|
|
import com.zhongshu.card.client.type.visitor.VisitorState;
|
|
import com.zhongshu.card.client.type.visitor.VisitorState;
|
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
import com.zhongshu.card.client.utils.DateUtils;
|
|
|
import com.zhongshu.card.server.core.dao.org.UserCountDao;
|
|
import com.zhongshu.card.server.core.dao.org.UserCountDao;
|
|
@@ -27,8 +24,8 @@ import com.zhongshu.card.server.core.domain.visitor.VisitorMain;
|
|
|
import com.zhongshu.card.server.core.domain.visitor.VisitorSetting;
|
|
import com.zhongshu.card.server.core.domain.visitor.VisitorSetting;
|
|
|
import com.zhongshu.card.server.core.service.base.CommonService;
|
|
import com.zhongshu.card.server.core.service.base.CommonService;
|
|
|
import com.zhongshu.card.server.core.service.devices.DeviceInfoServiceImpl;
|
|
import com.zhongshu.card.server.core.service.devices.DeviceInfoServiceImpl;
|
|
|
-import com.zhongshu.card.server.core.service.permissVerify.Device2UseUsableService;
|
|
|
|
|
import com.zhongshu.card.server.core.service.org.OrganizationUserServiceImpl;
|
|
import com.zhongshu.card.server.core.service.org.OrganizationUserServiceImpl;
|
|
|
|
|
+import com.zhongshu.card.server.core.service.permissVerify.Device2UseUsableService;
|
|
|
import com.zhongshu.card.server.core.service.permissVerify.SuperPermissService;
|
|
import com.zhongshu.card.server.core.service.permissVerify.SuperPermissService;
|
|
|
import com.zhongshu.card.server.core.service.user.UserAccountServiceImpl;
|
|
import com.zhongshu.card.server.core.service.user.UserAccountServiceImpl;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
@@ -104,6 +101,9 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
return ResultContent.buildFail("访问时长不能为空");
|
|
return ResultContent.buildFail("访问时长不能为空");
|
|
|
}
|
|
}
|
|
|
Long endTime = startTime + minutes * 60 * 1000l;
|
|
Long endTime = startTime + minutes * 60 * 1000l;
|
|
|
|
|
+ if (param.getApplyType() == null) {
|
|
|
|
|
+ return ResultContent.buildFail("applyType 不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 所属组件信息
|
|
// 所属组件信息
|
|
|
String sceneComponentId = param.getSceneComponentId();
|
|
String sceneComponentId = param.getSceneComponentId();
|
|
@@ -235,6 +235,32 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 取消申请 (申请审核通过后取消)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent cancelVisitApply(String id) {
|
|
|
|
|
+ VisitorMain visitorMain = visitorMainDao.findTopById(id);
|
|
|
|
|
+ if (visitorMain == null) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, id));
|
|
|
|
|
+ }
|
|
|
|
|
+ ResultContent resultContent = checkReViewInfo(visitorMain);
|
|
|
|
|
+ if (resultContent.isFailed()) {
|
|
|
|
|
+ return resultContent;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (visitorMain.getState() != VisitorState.WaitVisit) {
|
|
|
|
|
+ return ResultContent.buildFail("当前状态不能取消");
|
|
|
|
|
+ }
|
|
|
|
|
+ visitorMain.setIsCancel(Boolean.TRUE);
|
|
|
|
|
+ visitorMain.setState(VisitorState.Cancel);
|
|
|
|
|
+ visitorMain.setCancelUserId(getCurrentUserId());
|
|
|
|
|
+ visitorMain.setCancelTime(System.currentTimeMillis());
|
|
|
|
|
+ visitorMainDao.save(visitorMain);
|
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 审核通过
|
|
* 审核通过
|
|
|
*
|
|
*
|
|
@@ -293,11 +319,13 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
if (ObjectUtils.isEmpty(visitorMain)) {
|
|
if (ObjectUtils.isEmpty(visitorMain)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- // 封装使用记录参数
|
|
|
|
|
- deviceUserParam.setPermissFromType(DevicePermissFromType.Visitor);
|
|
|
|
|
- deviceUserParam.setUserName(visitorMain.getName());
|
|
|
|
|
- deviceUserParam.setUserFromType(visitorMain.getUserFromType());
|
|
|
|
|
- deviceUserParam.setAboutDataId(visitorMain.getId());
|
|
|
|
|
|
|
+ if (deviceUserParam != null) {
|
|
|
|
|
+ // 封装使用记录参数
|
|
|
|
|
+ deviceUserParam.setPermissFromType(DevicePermissFromType.Visitor);
|
|
|
|
|
+ deviceUserParam.setUserName(visitorMain.getName());
|
|
|
|
|
+ deviceUserParam.setUserFromType(visitorMain.getUserFromType());
|
|
|
|
|
+ deviceUserParam.setAboutDataId(visitorMain.getId());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 如果是 待来访 状态 则改为 已到访
|
|
// 如果是 待来访 状态 则改为 已到访
|
|
|
if (visitorMain.getState() == VisitorState.WaitVisit) {
|
|
if (visitorMain.getState() == VisitorState.WaitVisit) {
|
|
@@ -316,6 +344,29 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
return super.detailInfo(fromDataId);
|
|
return super.detailInfo(fromDataId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统计当前用户访客数据 (被访人员)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent staticCurrentUserTotal(VisitorStaticParam param) {
|
|
|
|
|
+ if (StringUtils.isEmpty(param.getProjectOid())) {
|
|
|
|
|
+ param.setProjectOid(getCurrentProjectOid());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isEmpty(param.getProjectOid())) {
|
|
|
|
|
+ return ResultContent.buildFail("projectOid 信息为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ VisitorStaticModel model = new VisitorStaticModel();
|
|
|
|
|
+
|
|
|
|
|
+ Long waitReViewNumber = 0L;
|
|
|
|
|
+
|
|
|
|
|
+ Long waitVisitNumber = 0L;
|
|
|
|
|
+
|
|
|
|
|
+ Long visitNumber = 0L;
|
|
|
|
|
+
|
|
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 检查数据 审核是否是否已过期
|
|
* 检查数据 审核是否是否已过期
|
|
|
*
|
|
*
|
|
@@ -348,7 +399,7 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
// 取消人脸
|
|
// 取消人脸
|
|
|
com.github.microservice.auth.client.content.ResultContent resultContent = userFaceService.delete(visitorMain.getTempUserId(), visitorMain.getFaceFileId());
|
|
com.github.microservice.auth.client.content.ResultContent resultContent = userFaceService.delete(visitorMain.getTempUserId(), visitorMain.getFaceFileId());
|
|
|
if (resultContent.isSuccess()) {
|
|
if (resultContent.isSuccess()) {
|
|
|
- visitorMain.setIsCancel(Boolean.TRUE);
|
|
|
|
|
|
|
+ visitorMain.setIsOverTime(Boolean.TRUE);
|
|
|
visitorMain.setIsClearFace(Boolean.TRUE);
|
|
visitorMain.setIsClearFace(Boolean.TRUE);
|
|
|
// 如果未使用,,则把状态改为 已失效
|
|
// 如果未使用,,则把状态改为 已失效
|
|
|
if (visitorMain.getState() == VisitorState.WaitVisit) {
|
|
if (visitorMain.getState() == VisitorState.WaitVisit) {
|
|
@@ -381,6 +432,7 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
// 审核通过
|
|
// 审核通过
|
|
|
param.setReViewSuccess(Boolean.TRUE);
|
|
param.setReViewSuccess(Boolean.TRUE);
|
|
|
// 未权限
|
|
// 未权限
|
|
|
|
|
+ param.setIsOverTime(Boolean.FALSE);
|
|
|
param.setIsCancel(Boolean.FALSE);
|
|
param.setIsCancel(Boolean.FALSE);
|
|
|
|
|
|
|
|
Pageable pageable = PageRequest.of(0, 100);
|
|
Pageable pageable = PageRequest.of(0, 100);
|