| | |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * JWT获取令牌和刷新令牌接口 |
| | |
| | | */ |
| | | @PostMapping("/logout") |
| | | @ApiOperation("退出登陆") |
| | | public ApiResponse<String> logout(@RequestHeader(Constants.HEADER_USER_TOKEN) String oldToken){ |
| | | public ApiResponse<String> logout(@RequestHeader(Constants.HEADER_USER_TOKEN) String oldToken,Integer isH5){ |
| | | try { |
| | | jwtTokenUtil.logout(oldToken); |
| | | |
| | | |
| | | |
| | | if(Objects.nonNull(isH5)){ |
| | | jwtTokenUtil.logoutForH5(oldToken); |
| | | }else{ |
| | | jwtTokenUtil.logout(oldToken); |
| | | } |
| | | }catch (BusinessException e){ |
| | | return ApiResponse.failed(e.getCode(),e.getMessage()); |
| | | }catch (Exception e){ |
| | |
| | | package com.doumee.config.jwt; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private JwtProperties jwtProperties; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz ; |
| | | |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | /** |
| | | * 生成token令牌 |
| | | * |
| | |
| | | // this.hkLoginOut(url+"?token="+loginUserInfo.getHkMenuToken()); |
| | | HttpsUtil.get(url+"?token="+loginUserInfo.getHkMenuToken(),true); |
| | | } |
| | | redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token);//删除老的token |
| | | |
| | | //删除老的token |
| | | redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public void logoutForH5(String token) { |
| | | try { |
| | | //登出海康系统数据 |
| | | LoginUserInfo loginUserInfo = this.getUserInfoByToken(token); |
| | | //删除老的token |
| | | redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token); |
| | | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda().set(SystemUser::getOpenid,null).eq(SystemUser::getId,loginUserInfo.getId())); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | public void hkLoginOut(String url){ |
| | | try { |
| | | // 创建HttpClient对象 |
| | |
| | | public static final String SIGN_IN_PLACE_LNT ="SIGN_IN_PLACE_LNT" ; |
| | | public static final String SIGN_IN_PLACE_DISTANCE ="SIGN_IN_PLACE_DISTANCE" ; |
| | | public static final String SIGN_IN_QRCODE ="SIGN_IN_QRCODE" ; |
| | | public static final String SIGN_IN_ATTENTION ="SIGN_IN_ATTENTION" ; |
| | | public static final String SIGN_IN_QRCODE_PREFIX ="SIGN_IN_QRCODE_PREFIX" ; |
| | | |
| | | |
| | | //被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验) |
| | |
| | | public static final String PLATFORM_EVENT_IMG = "PLATFORM_EVENT_IMG"; |
| | | public static final String VISIT_NOTICE = "VISIT_NOTICE"; |
| | | public static final String TIME_OUT_CONFIG = "TIME_OUT_CONFIG"; |
| | | public static final String VISIT_REPORT_TIME_OUT_MOBILE = "VISIT_REPORT_TIME_OUT_MOBILE"; |
| | | public static final String VISIT_TIME_OUT_MOBILE = "VISIT_TIME_OUT_MOBILE"; |
| | | |
| | | //健康证配置 |
| | | public static final String LW_HEALTH_CARD = "LW_HEALTH_CARD"; |
| | |
| | | String visitAuditFail = "visitAuditFail"; |
| | | //访客申请-超时未签离-通知(给申请人): |
| | | String visitTimeOutSignOut = "visitTimeOutSignOut"; |
| | | //访客申请-未签离数量-通知(给指定接收人) //TODO 无收短信人员 |
| | | //访客申请-未签离数量-通知(给指定接收人) |
| | | String visitTimeOutSignOutNum = "visitTimeOutSignOutNum"; |
| | | |
| | | } |
| | |
| | | //验证人脸评分 |
| | | //人脸评分 |
| | | FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode(); |
| | | param.setFacePicUrl(prefixUrl + fileName); |
| | | BaseResponse<FacePictureCheckResponse> responseBaseResponse = HKService.facePictureCheck(param); |
| | | if(responseBaseResponse == null || !StringUtils.equals(responseBaseResponse.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = responseBaseResponse.getData(); |
| | | if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | if(!facePictureCheckResponse.getCheckResult()){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | context.put("code", 0); |
| | | context.put("message", facePictureCheckResponse.getStatusMessage()); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | |
| | | @ApiOperation("访客记录 - 分页列表") |
| | | @PostMapping("/visitPage") |
| | | public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap) { |
| | | if(Objects.isNull(pageWrap.getModel().getMemberId())){ |
| | | if(Objects.isNull(pageWrap.getModel()) || StringUtils.isBlank(pageWrap.getModel().getOpenid())){ |
| | | pageWrap.getModel().setMemberId(0); |
| | | } |
| | | return ApiResponse.success(visitsService.findPage(pageWrap)); |
| | |
| | | @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/upload", headers = "content-type=multipart/form-data") |
| | | public void uploadMobile(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public void uploadMobile(String folder, HttpServletRequest request, HttpServletResponse response,Integer isFace) throws Exception { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | upload(multipartRequest, response, folder + "/", |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.BUCKETNAME).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_ID).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_KEY).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode()); |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode(),isFace); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/uploadPicture", headers = "content-type=multipart/form-data") |
| | | public void uploadPicture(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public void uploadPicture(String folder, HttpServletRequest request, HttpServletResponse response,Integer isFace) throws Exception { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Iterator<String> fileNames = multipartRequest.getFileNames(); |
| | | Map<String, Object> context = new HashMap<>(); |
| | |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_ID).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_KEY).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode()); |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode(),isFace); |
| | | } |
| | | |
| | | |
| | |
| | | //验证人脸评分 |
| | | //人脸评分 |
| | | FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode(); |
| | | param.setFacePicUrl(prefixUrl + fileName); |
| | | BaseResponse<FacePictureCheckResponse> responseBaseResponse = HKService.facePictureCheck(param); |
| | | if(responseBaseResponse == null || !StringUtils.equals(responseBaseResponse.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(com.doumee.core.constants.ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | // throw new BusinessException(com.doumee.core.constants.ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = responseBaseResponse.getData(); |
| | | if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | throw new BusinessException(com.doumee.core.constants.ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | // throw new BusinessException(com.doumee.core.constants.ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | if(!facePictureCheckResponse.getCheckResult()){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | context.put("code", 0); |
| | | context.put("message", facePictureCheckResponse.getStatusMessage()); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | public void upload(HttpServletRequest request, HttpServletResponse response, String folder, String bucketName, |
| | | String access_id, String access_key, String resourcePath, String endpoint) throws Exception { |
| | | String access_id, String access_key, String resourcePath, String endpoint,Integer isFace) throws Exception { |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | Map<String, Object> context = new HashMap<>(); |
| | |
| | | ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key); |
| | | if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) { |
| | | // 移动成功,返回文件名 |
| | | // sendSuccessMessage(response, resourcePath+key); |
| | | if(Constants.equalsInteger(isFace,Constants.ZERO)){ |
| | | //验证人脸评分 |
| | | //人脸评分 |
| | | FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode(); |
| | | param.setFacePicUrl(prefixUrl + key); |
| | | BaseResponse<FacePictureCheckResponse> responseBaseResponse = HKService.facePictureCheck(param); |
| | | if(responseBaseResponse == null || !StringUtils.equals(responseBaseResponse.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = responseBaseResponse.getData(); |
| | | if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | context.put("code", 0); |
| | | context.put("message", "对不起,人脸评分获取数据失败~"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | if(!facePictureCheckResponse.getCheckResult()){ |
| | | context.put("code", 0); |
| | | context.put("message", facePictureCheckResponse.getStatusMessage()); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | | context.put("errno",0); |
| | |
| | | // 审批通过给申请人:申请已审核通过 |
| | | String visitAuditSuccess = "visitAuditSuccess"; |
| | | // 审批驳回给申请人:申请已被驳回 |
| | | String visitAuditFail = "visitWaitAudit"; |
| | | String visitAuditFail = "visitAuditFail"; |
| | | // 给审批人:申请待您审批 |
| | | String visitWaitAudit = "visitWaitAudit"; |
| | | } |
| | |
| | | public void sendVisitTemplateNotice(WxNoticeConfigMapper wxNoticeConfigMapper, Visits visits, String objCode, String token, List<String> openIds){ |
| | | try{ |
| | | if(CollectionUtils.isNotEmpty(openIds)){ |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit) |
| | | WxNoticeConfig wxNoticeConfig = wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda() |
| | | .in(WxNoticeConfig::getObjType,WxPlatConstants.visit,WxPlatConstants.visitReport) |
| | | .eq(WxNoticeConfig::getObjCode,objCode) |
| | | .eq(WxNoticeConfig::getStatus, Constants.ZERO) |
| | | .last(" limit 1") |
| | |
| | | Map<String, Object> thing1 = new HashMap<String,Object>(); |
| | | thing1.put("value", visits.getName()); |
| | | Map<String, Object> car_number7 = new HashMap<String,Object>(); |
| | | car_number7.put("value",StringUtils.isNotBlank(visits.getCarNos())?visits.getCarNos():"-"); |
| | | car_number7.put("value",StringUtils.isNotBlank(visits.getCarNos())?visits.getCarNos():"无"); |
| | | dataMap.put("car_number7",car_number7); |
| | | Map<String, Object> character_string6 = new HashMap<String,Object>(); |
| | | character_string6.put("value","1"); |
| | | Map<String, Object> thing4 = new HashMap<String,Object>(); |
| | | thing4.put("value",visits.getReason()); |
| | | dataMap.put("const9",const9); |
| | | dataMap.put("thing1",thing1); |
| | | dataMap.put("car_number7",car_number7); |
| | | dataMap.put("character_string6",character_string6); |
| | | dataMap.put("thing4",thing4); |
| | | paramMap.put("data", dataMap); |
| | |
| | | @TableField(exist = false) |
| | | private String optRemark; |
| | | |
| | | @ApiModelProperty(value = "system openid" , hidden = true) |
| | | @TableField(exist = false) |
| | | private String systemOpenid; |
| | | |
| | | @ApiModelProperty(value = "培训开始时间") |
| | | @TableField(exist = false) |
| | | private Date trainStartTime; |
| | |
| | | @ApiModelProperty(value = "二维码值") |
| | | private String qrCode; |
| | | |
| | | @ApiModelProperty(value = "注意事项") |
| | | private String attention; |
| | | |
| | | } |
| | |
| | | for (int i = 0; i < approveParamList.size(); i++) { |
| | | ApproveParam approveParam = approveParamList.get(i); |
| | | List<Integer> ids = this.getApproveUserIds(approveParam,createMember); |
| | | List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>().lambda().in(Member::getId,ids)); |
| | | List<Member> memberList = memberMapper.selectJoinList(Member.class, |
| | | new MPJLambdaWrapper<Member>() |
| | | .selectAll(Member.class) |
| | | .selectAs(SystemUser::getOpenid,Member::getSystemOpenid) |
| | | .leftJoin(SystemUser.class,SystemUser::getMemberId,Member::getId) |
| | | .in(Member::getId,ids) |
| | | ); |
| | | List<String> memberNameList =memberList.stream().map(m->m.getName()).collect(Collectors.toList()); |
| | | String memberNames = String.join(",",memberNameList); |
| | | Integer noticeType = Constants.approveTypeToNoticeType(approveTempl.getType()); |
| | |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //公众号通知 |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | if(StringUtils.isNotBlank(member.getSystemOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitContent.visitWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | Arrays.asList(member.getSystemOpenid().split(",")) |
| | | ); |
| | | } |
| | | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visitReporting)){ |
| | |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //公众号通知 |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | if(StringUtils.isNotBlank(member.getSystemOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitReportContent.visitReportWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | Arrays.asList(member.getSystemOpenid().split(",")) |
| | | ); |
| | | } |
| | | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.useCar)){ |
| | |
| | | null,Arrays.asList(member.getPhone().split(",")) |
| | | ); |
| | | //公众号通知 |
| | | if(StringUtils.isNotBlank(member.getOpenid())){ |
| | | if(StringUtils.isNotBlank(member.getSystemOpenid())){ |
| | | wxPlatNotice.sendCarUseBookTemplateNotice( |
| | | wxNoticeConfigMapper, |
| | | carUseBookMapper.selectById(businessId), |
| | | WxPlatConstants.carUseBookContent.carUseBookWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getOpenid().split(",")), |
| | | Arrays.asList(member.getSystemOpenid().split(",")), |
| | | Constants.ONE); |
| | | } |
| | | } |
| | |
| | | SmsConstants.visitReportingContent.visitReportingAuditFail, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitReportContent.visitReportAuditSuccess:WxPlatConstants.visitReportContent.visitReportAuditFail; |
| | | |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? |
| | | WxPlatConstants.visitReportContent.visitReportAuditSuccess:WxPlatConstants.visitReportContent.visitReportAuditFail; |
| | | |
| | | }else{ //访客申请 |
| | | //发送短信通知 |
| | |
| | | SmsConstants.visitContent.visitAuditFail, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitContent.visitAuditSuccess:WxPlatConstants.visitContent.visitAuditFail; |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitContent.visitAuditSuccess: |
| | | WxPlatConstants.visitContent.visitAuditFail; |
| | | } |
| | | visitsMapper.updateById(visits); |
| | | //发送微信公众号 |
| | | if(StringUtils.isNotBlank(objCode)){ |
| | | Member member = memberMapper.selectById(visits.getCreateMemberId()); |
| | | if(Objects.nonNull(member) && StringUtils.isNotBlank(member.getOpenid())){ |
| | | if(Objects.nonNull(visits) && StringUtils.isNotBlank(visits.getOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice( |
| | | wxNoticeConfigMapper,visits, objCode, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(member.getOpenid().split(",")) |
| | | Arrays.asList(visits.getOpenid().split(",")) |
| | | ); |
| | | } |
| | | } |
| | |
| | | openId = tokenJson.getString("openid"); |
| | | } |
| | | WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO(); |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | if(StringUtils.isBlank(openId)){ |
| | | return wxAuthorizeVO; |
| | | } |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | if(source==1){ |
| | | //根据openId 查询用户信息 |
| | | Member member = memberJoinMapper.selectJoinOne(Member.class,new MPJLambdaWrapper<Member>() |
| | |
| | | } |
| | | |
| | | public void sceneSignIn(SignInDTO signInDTO){ |
| | | |
| | | if( StringUtils.isNotBlank(signInDTO.getQrCodeKey())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!signInDTO.getQrCodeKey().equals(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ |
| | | if(!signInDTO.getQrCodeKey().equals( |
| | | systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode() + systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"二维码已过期,请刷新重试"); |
| | | } |
| | | } |
| | |
| | | List<PlatformJob> calledList = platformJobList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()); |
| | | largeScreenDataVO.setWaitWorkList(calledList); |
| | | } |
| | | largeScreenDataVO.setQrCode(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode()); |
| | | largeScreenDataVO.setQrCode(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode() + systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE).getCode()); |
| | | largeScreenDataVO.setAttention(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_ATTENTION).getCode()); |
| | | return largeScreenDataVO; |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public static void sendVisitReportTimeOutSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , |
| | | SmsConfigMapper smsConfigMapper, |
| | | String objCode, String msg,List<String> mobiles){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | | //开启短信通知 |
| | | if(Objects.nonNull(smsConfig) || Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode() + smsConfig.getContent(); |
| | | //超时特殊处理 |
| | | if(smsConfig.getCode().equals(SmsConstants.visitReportingContent.visitReportingTimeOutSignOutNum)){ |
| | | //今日还有{未签离数量}个访客报备车辆未离场,请前往PC端查看详细信息。 |
| | | content = content.replace("{未签离数量}",msg); |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | mobiles,SmsConstants.visitReport,content,0); |
| | | return; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void sendVisitTimeOutSms(SystemDictDataBiz systemDictDataBiz, EmayService emayService , com.doumee.dao.business.dao.SmsEmailMapper smsEmailMapper , |
| | | SmsConfigMapper smsConfigMapper, |
| | | String objCode, String msg,List<String> mobiles){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | | //开启短信通知 |
| | | if(Objects.nonNull(smsConfig) || Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode() + smsConfig.getContent(); |
| | | //超时特殊处理 |
| | | if(smsConfig.getCode().equals(SmsConstants.visitContent.visitTimeOutSignOutNum)){ |
| | | //今日还有{未签离数量}个访客报备车辆未离场,请前往PC端查看详细信息。 |
| | | content = content.replace("{未签离数量}",msg); |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | mobiles,SmsConstants.visit,content,0); |
| | | return; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 隐患随手拍 |
| | | * @param systemDictDataBiz |
| | |
| | | //初始化访客信息 |
| | | initVisitInfo(visits,date); |
| | | |
| | | if(StringUtils.isNotBlank(visits.getFaceImg())&&(Constants.equalsInteger(visits.getType(),Constants.ZERO)|| Constants.equalsInteger(visits.getType(),Constants.TWO))){ |
| | | //人脸评分 |
| | | FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | param.setFacePicUrl(prefixUrl + visits.getFaceImg()); |
| | | BaseResponse<FacePictureCheckResponse> response = HKService.facePictureCheck(param); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = response.getData(); |
| | | if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | } |
| | | if(!facePictureCheckResponse.getCheckResult()){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | } |
| | | } |
| | | |
| | | // if(StringUtils.isNotBlank(visits.getFaceImg())&&(Constants.equalsInteger(visits.getType(),Constants.ZERO)|| Constants.equalsInteger(visits.getType(),Constants.TWO))){ |
| | | // //人脸评分 |
| | | // FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | // String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() + |
| | | // systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | // param.setFacePicUrl(prefixUrl + visits.getFaceImg()); |
| | | // BaseResponse<FacePictureCheckResponse> response = HKService.facePictureCheck(param); |
| | | // if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | // } |
| | | // FacePictureCheckResponse facePictureCheckResponse = response.getData(); |
| | | // if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | // } |
| | | // if(!facePictureCheckResponse.getCheckResult()){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | // } |
| | | // } |
| | | visits.setSendTimeOutNotice(Constants.ZERO); |
| | | visitsMapper.insert(visits); |
| | | |
| | | //发起ERP审批申请 |
| | |
| | | .eq(Visits::getSendTimeOutNotice,Constants.ZERO) |
| | | .apply(" now() >= DATE_ADD(ENDTIME,INTERVAL -"+times+" MINUTE) ") |
| | | ); |
| | | Integer visitTimeCount = 0; |
| | | Integer visitReportTimeCount = 0; |
| | | for (Visits visits:visitsList) { |
| | | if(Constants.equalsInteger(visits.getType(),Constants.TWO)){ |
| | | SmsEmailServiceImpl.sendVisitReportSms(systemDictDataBiz, |
| | |
| | | SmsConstants.visitReportingContent.visitReportingTimeOutSignOut, |
| | | null,Arrays.asList(visits.getPhone().split(",")) |
| | | ); |
| | | visitReportTimeCount = visitReportTimeCount + 1; |
| | | }else{ |
| | | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,visits.getId(), |
| | | SmsConstants.visitContent.visitTimeOutSignOut, |
| | | null,Arrays.asList(visits.getPhone().split(",")) |
| | | ); |
| | | visitTimeCount = visitTimeCount + 1 ; |
| | | } |
| | | visits.setSendTimeOutNotice(Constants.ONE); |
| | | visitsMapper.updateById(visits); |
| | | } |
| | | |
| | | if(visitTimeCount > 0 ){ |
| | | String mobile = systemDictDataBiz.queryByCode(Constants.VISIT_CONFIG,Constants.VISIT_TIME_OUT_MOBILE).getCode(); |
| | | if(StringUtils.isNotBlank(mobile)){ |
| | | SmsEmailServiceImpl.sendVisitTimeOutSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper, |
| | | SmsConstants.visitContent.visitTimeOutSignOutNum, |
| | | visitReportTimeCount.toString(),Arrays.asList(mobile.split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | if(visitReportTimeCount > 0 ){ |
| | | String mobile = systemDictDataBiz.queryByCode(Constants.VISIT_CONFIG,Constants.VISIT_REPORT_TIME_OUT_MOBILE).getCode(); |
| | | if(StringUtils.isNotBlank(mobile)){ |
| | | SmsEmailServiceImpl.sendVisitReportTimeOutSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper, |
| | | SmsConstants.visitReportingContent.visitReportingTimeOutSignOutNum, |
| | | visitReportTimeCount.toString(),Arrays.asList(mobile.split(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | |