|
|
@@ -86,6 +86,12 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
@Autowired
|
|
|
private OrgUserFaceService orgUserFaceService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存访客申请
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public ResultContent saveInfo(VisitorMainParam param) {
|
|
|
if (StringUtils.isEmpty(param.getSceneComponentId())) {
|
|
|
return ResultContent.buildFail("sceneComponentId 不能为空");
|
|
|
@@ -111,6 +117,14 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
if (endTime <= System.currentTimeMillis()) {
|
|
|
return ResultContent.buildFail("访问结束时间不能小于当前时间");
|
|
|
}
|
|
|
+ String openid = param.getOpenId();
|
|
|
+ if (StringUtils.isEmpty(openid)) {
|
|
|
+ openid = getOpenId();
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(openid)) {
|
|
|
+ return ResultContent.buildFail("openid不能为空");
|
|
|
+ }
|
|
|
+ param.setOpenId(openid);
|
|
|
|
|
|
// 所属组件信息
|
|
|
String sceneComponentId = param.getSceneComponentId();
|
|
|
@@ -127,6 +141,7 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
return ResultContent.buildFail("projectOid 信息为空");
|
|
|
}
|
|
|
|
|
|
+ // 访客组件配置
|
|
|
VisitorSetting visitorSetting = visitorSettingDao.findTopBySceneComponentIdAndProjectOid(sceneComponentId, projectOid);
|
|
|
if (ObjectUtils.isEmpty(visitorSetting)) {
|
|
|
return ResultContent.buildFail("访客组件参数未配置");
|
|
|
@@ -138,12 +153,12 @@ public class VisitorMainService extends SuperPermissService {
|
|
|
return ResultContent.buildFail(conformFaceContent.getMsg());
|
|
|
}
|
|
|
|
|
|
- // 判断
|
|
|
+ // 判断访客是否存在
|
|
|
UserAccount visitorUserAccount = userCountDao.findTopByUserId(param.getVisitorUserId());
|
|
|
if (ObjectUtils.isEmpty(visitorUserAccount)) {
|
|
|
return ResultContent.buildFail("被访人不存在");
|
|
|
}
|
|
|
- OrganizationUser organizationUser = organizationUserService.getUserInProjectBindOrgUserInfo(projectOid, visitorUserAccount);
|
|
|
+ OrganizationUser organizationUser = organizationUserService.getUserTopInProjectBindOrgUserInfo(projectOid, visitorUserAccount);
|
|
|
|
|
|
VisitorMain entity = null;
|
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|