Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit
| | |
| | | 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){ |
| | |
| | | spring: |
| | | profiles: |
| | | active: |
| | | active: pro |
| | | application: |
| | | name: system_gateway |
| | | # å®å
¨é
ç½® |
| | |
| | | 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"; |
| | |
| | | public static final String HK_WXTOKEN_CONFIGID ="HK_WXTOKEN_CONFIGID" ; |
| | | public static final String HK_WXTOKEN_TAGID ="HK_WXTOKEN_TAGID" ; |
| | | public static final String WMS_TOTAL_STOCK_NUM ="WMS_TOTAL_STOCK_NUM" ; |
| | | public static final String WX_REDIRECT_URL = "WX_REDIRECT_URL"; |
| | | public static boolean DEALING_HK_SYNCPRIVILEGE= false; |
| | | public static boolean DEALING_HK_SYNCDEVICE = false; |
| | | public static boolean DEALING_HK_SYNCPLATFORM = false; |
| | |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå
¬ä¼å·è·³è½¬éå®åä¸å¡å°å |
| | | * @param code |
| | | * @param paramCode |
| | | * @param ywid |
| | | * @return |
| | | */ |
| | | public static String getWxUrl(String code, WxUrlParams paramCode, String ywid) { |
| | | return code.replace("${type}",paramCode.type+"").replace("${yw}",paramCode.yw).replace("${ywid}",ywid); |
| | | } |
| | | |
| | | public interface VisitIccmStatus{ |
| | | //è®¿å®¢ç¶æ(0:æªç¾å°,1:å·²ç¾å°,2:å·²ç¾é,3:æ»ç,4:æªè®¿é®,5:èªå¨ç¾ç¦»,6:æªç¾é) |
| | | int waitSign = 0; |
| | |
| | | public interface RedisKeys { |
| | | public static final String IMPORTING_CARS ="IMPORTING_CARS"; |
| | | public static final String IMPORTING_MEMBER ="IMPORTING_MEMBER"; |
| | | public static final String BIGSCREEN_UUID ="BIGSCREEN_UUID"; |
| | | public static final String IMPORTING_GAS ="IMPORTING_GAS"; |
| | | public static final String ERP_TOKEN ="ERP_TOKEN"; |
| | | public static final long EXPIRE_TIME = 7200; |
| | |
| | | } |
| | | |
| | | } |
| | | public enum WxUrlParams { |
| | | BISCREEN_CODE(0,0, "0", "é¨å£å¤§å±äºç»´ç "), |
| | | MEETING_CODE(1,1, "1","ä¼è®®å®¤å¤§å±") |
| | | ; |
| | | // æååé |
| | | private int key; |
| | | private int type;//ç¨æ·ç±»å 0åå·¥ 1叿º |
| | | private String yw;//ä¸å¡ç±»å |
| | | private String info;//说æ |
| | | |
| | | // æé æ¹æ³ |
| | | WxUrlParams(int key,int type, String yw,String info) { |
| | | this.yw = yw; |
| | | this.key = key; |
| | | this.type = type; |
| | | this.info= info; |
| | | } |
| | | |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getYw() { |
| | | return yw; |
| | | } |
| | | |
| | | public void setYw(String yw) { |
| | | this.yw = yw; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | } |
| | | public static <T> T toSnakeObject(String json, Class<T> clazz) throws IOException { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); |
| | |
| | | String visitAuditFail = "visitAuditFail"; |
| | | //访客ç³è¯·-è¶
æ¶æªç¾ç¦»-éç¥ï¼ç»ç³è¯·äººï¼ï¼ |
| | | String visitTimeOutSignOut = "visitTimeOutSignOut"; |
| | | //访客ç³è¯·-æªç¾ç¦»æ°é-éç¥ï¼ç»æå®æ¥æ¶äººï¼ //TODO æ æ¶ç信人å |
| | | //访客ç³è¯·-æªç¾ç¦»æ°é-éç¥ï¼ç»æå®æ¥æ¶äººï¼ |
| | | String visitTimeOutSignOutNum = "visitTimeOutSignOutNum"; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "微信openid", example = "1", hidden = true) |
| | | private String openid; |
| | | @ApiModelProperty(value = "微信openidæ¨éæµ·åº·ç¶æ 0å¾
æ¨é 1å·²æ¨é 2ç»å®å¤±è´¥", example = "1", hidden = true) |
| | | private Integer openidHkStatus; |
| | | @ApiModelProperty(value = "微信openidæ¨éæµ·åº·å¤æ³¨ ", example = "1", hidden = true) |
| | | private String openidHkInfo; |
| | | @ApiModelProperty(value = "微信openidæ¨é海康æ¶é´", example = "1", hidden = true) |
| | | private Date openidHkDate; |
| | | |
| | | //2024å¹´12æ6æ¥11:00:30 ç±»å 0叿ºäººå 1æ®é访客 2å
é¨äººå |
| | | @ApiModelProperty(value = "ç±»å 0å¹³å°ç¨æ· 1访客", example = "0") |
| | |
| | | //妿openIdä¸ä¸ºç©º,ç»å®è¯¥ç¨æ·openid |
| | | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda() |
| | | .set(SystemUser::getOpenid,null) |
| | | .set(SystemUser::getOpenidHkDate,null) |
| | | .set(SystemUser::getOpenidHkInfo,null) |
| | | .set(SystemUser::getOpenidHkStatus,Constants.ZERO) |
| | | .eq(SystemUser::getOpenid,openid) |
| | | .eq(SystemUser::getType,user.getType())); |
| | | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda() |
| | | .set(SystemUser::getOpenid,openid) |
| | | .set(SystemUser::getOpenidHkStatus,Constants.ZERO) |
| | | .set(SystemUser::getOpenidHkDate,null) |
| | | .set(SystemUser::getOpenidHkInfo,null) |
| | | .eq(SystemUser::getId,user.getId())); |
| | | } |
| | | } |
| | |
| | | //éªè¯äººè¸è¯å |
| | | //人è¸è¯å |
| | | 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); |
| | |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.DeviceService; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import com.doumee.service.business.impl.hksync.ferp.HkSyncOrgUserToHKServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | private HkSyncPrivilegeServiceImpl hkSyncPrivilegeService; |
| | | @Autowired |
| | | private HkSyncPushServiceImpl hkSyncPushService; |
| | | @Autowired |
| | | private HkSyncOrgUserToHKServiceImpl hkSyncOrgUserToHKService; |
| | | @Autowired |
| | | private HkSyncNoticeServiceImpl hkSyncNoticeService; |
| | | @Autowired |
| | |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("ãæµ·åº·ãä¿ææµ·åº·ç¨æ·ç»å®openid") |
| | | @PostMapping("/saveHkUserOpenid") |
| | | public ApiResponse syncHkUserOpenid( @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = hkSyncOrgUserToHKService.syncHkUserOpenid(this.getLoginUser(token).getId()); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("ãæµ·åº·ãè·åç»ä»¶ææç»å½å°åæ¥å£") |
| | | @PostMapping("/getServiceUrl") |
| | | public ApiResponse getServiceUrl(@RequestBody HKGetServiceLoginUrlRequest param,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("è·åå½åç¨æ·çæè¿ä¸æ¡å¾
ç¾å°çä½ä¸ä¿¡æ¯") |
| | | @GetMapping("/getLastWaitJob") |
| | | @LoginNoRequired |
| | | public ApiResponse<PlatformJob> getLastWaitJob(@RequestParam String uuid,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success( platformJobService.getLastWaitJob(uuid,this.getLoginUser(token))); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:platformjob:delete") |
| | |
| | | @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[] findAlarmBaseDataStatistic= new String[]{"/api/v1/alarm/findAlarmBaseDataStatistic","æ¶é²çæ¿-4æ¥è¦ä¿¡æ¯ç»è®¡"};//æ¶é²çæ¿-4æ¥è¦ä¿¡æ¯ç»è®¡ |
| | | String[] findHomeAlarmInfoPage= new String[]{"/api/v1/alarm/findHomeAlarmInfoPage","å®é²çæ¿-- å页æ¥è¯¢æªå¤çæ¥è¦ä¿¡æ¯6"};//å®é²çæ¿-- å页æ¥è¯¢æªå¤çæ¥è¦ä¿¡æ¯6 |
| | | String[] minitorDataSearchV1= new String[]{"/api/fem/v1/minitor/data/search","å页æ¥è¯¢è®¾å¤çæµå岿°æ®"};//å页æ¥è¯¢è®¾å¤çæµå岿°æ® |
| | | String[] minitorDataSearch= new String[]{"/api/fpms/v2/minitor/data/search"};//å页æ¥è¯¢è®¾å¤çæµå岿°æ® |
| | | String[] minitorDataSearch= new String[]{"/api/fpms/v2/minitor/data/search","å页æ¥è¯¢è®¾å¤çæµå岿°æ®"};//å页æ¥è¯¢è®¾å¤çæµå岿°æ® |
| | | String[] userOpenidSave= new String[]{"/api/v1/oa/userOpenId/saveV2","ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å·"};//ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å· |
| | | } |
| | | /** |
| | | * éå½A.55æ¶é²è®¾å¤ç±»å |
| | |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.findAlarmBaseDataStatistic,body); |
| | | } |
| | | /** |
| | | *å®é²çæ¿-- å页æ¥è¯¢æªå¤çæ¥è¦ä¿¡æ¯6 |
| | | *å®é²çæ¿-- b |
| | | * @param body |
| | | * @return |
| | | */ |
| | |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.findHomeAlarmInfoPage,body); |
| | | } |
| | | /** |
| | | *ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å· |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static String userOpenidSave(String body) { |
| | | Map<String,String> header = new HashMap<>(); |
| | | header.put("userId","admin"); |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.userOpenidSave,null,header,body); |
| | | } |
| | | /** |
| | | *å页æ¥è¯¢è®¾å¤çæµå岿°æ® |
| | | * @param body |
| | | * @return |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.request; |
| | | |
| | | import com.doumee.core.haikang.model.param.BaseListPageRequest; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserOpenidSaveRequest extends BaseListPageRequest { |
| | | private String openId ;//String false 微信openId |
| | | private String userName ;//String false å¹³å°ç¨æ·å |
| | | private String appKey ;//String false appKey |
| | | private String oaId;// String false atwl |
| | | private String platformName ;//String false 宿³°ç©æµååº |
| | | private String operateTime ;//String false 2024-12-09T15:49:04-07:00 |
| | | } |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å· |
| | | * @return |
| | | */ |
| | | public static BaseResponse<Integer> userOpenidSave(UserOpenidSaveRequest param){ |
| | | log.info("ãæµ·åº·ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å·ã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.userOpenidSave(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<Integer>>(){}; |
| | | BaseResponse<Integer> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å·"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("ãæµ·åº·ä¿åç¨æ·åopenIdç»å®ä¿¡æ¯å¾®ä¿¡å
¬ä¼å·ã================失败====ï¼\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *å页æ¥è¯¢è®¾å¤çæµå岿°æ® |
| | | * @return |
| | | */ |
| | |
| | | // 审æ¹éè¿ç»ç³è¯·äººï¼ç³è¯·å·²å®¡æ ¸éè¿ |
| | | 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; |
| | | |
| | | } |
| | |
| | | */ |
| | | void timeOutWork(); |
| | | |
| | | PlatformJob getLastWaitJob(String uuid, LoginUserInfo loginUser); |
| | | } |
| | |
| | | String dealPlatformStatusEvent(EventPlatformRequest param, HttpServletResponse response); |
| | | |
| | | String dealPlatformCarsEvent(EventPlatformCarsRequest param, HttpServletResponse response); |
| | | |
| | | String syncHkUserOpenid(Integer id); |
| | | } |
| | |
| | | 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(",")) |
| | | ); |
| | | } |
| | | } |
| | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼å工信æ¯åæ¥å®é²å¹³å°å¤±è´¥ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | }catch (BusinessException e){ |
| | | //妿åçå¼å¸¸ï¼å é¤å·²ç»å建ç人åä¿¡æ¯ |
| | | deleteHkUserBiz(new String[]{insert.getHkId()}); |
| | | throw e; |
| | | }catch (Exception e){ |
| | | //妿åçå¼å¸¸ï¼å é¤å·²ç»å建ç人åä¿¡æ¯ |
| | | e.printStackTrace(); |
| | |
| | | * @return |
| | | */ |
| | | private boolean dealHkUserBiz(Member insert) { |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | UserAddRequest hkAddRequest = HkSyncOrgUserToHKServiceImpl.getUserAddModel(insert,path,Constants.ZERO); |
| | | if(hkAddRequest == null){ |
| | |
| | | return false; |
| | | } |
| | | private boolean dealHkUserForUpdateBiz(Member update ) { |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | |
| | | UserAddRequest hkAddRequest = HkSyncOrgUserToHKServiceImpl.getUserAddModel(update,path,Constants.ONE); |
| | |
| | | .ne(Member::getId,member.getId())) >0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "身份è¯å·ã"+member.getIdcardNoNew()+"ã已被使ç¨ï¼ä¸è½éå¤"); |
| | | } |
| | | |
| | | member.setSex(Constants.getSexByCardNo( member.getIdcardNoNew()));//æ ¹æ®èº«ä»½è¯å·è·åæ§å« |
| | | member.setIdcardDecode( Constants.getTuominStr(member.getIdcardNoNew())); |
| | | member.setIdcardNo(encrptNo); |
| | |
| | | wrapper.lambda().ne(Member::getRemark,"人è¸å·²åæ¥ææ°"); |
| | | List<Member> list =memberMapper.selectList(wrapper); |
| | | if(list!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | for(Member m : list){ |
| | | String faceId= HkSyncOrgUserToHKServiceImpl.dealMemberFace(m,path); |
| | |
| | | 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>() |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | @Autowired |
| | | private PlatformBroadcastLogMapper platformBroadcastLogMapper; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | 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(),"äºç»´ç å·²è¿æ,è¯·å·æ°éè¯"); |
| | | } |
| | | } |
| | |
| | | return platformJob; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 宿ä½ä¸ |
| | | */ |
| | | public PlatformJob getLastWaitJob(String uuid, LoginUserInfo loginUser){ |
| | | String u = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.BIGSCREEN_UUID); |
| | | if(!StringUtils.equals(u,uuid)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼äºç»´ç 已失æï¼"); |
| | | } |
| | | PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getDrivierPhone,loginUser.getMobile()) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()) |
| | | .orderByDesc(PlatformJob::getCreateDate) |
| | | .last(" limit 1 ") ); |
| | | return platformJob; |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public PlatformJob finishWork(JobOperateDTO jobOperateDTO){ |
| | |
| | | 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()); |
| | | String u = UUID.randomUUID().toString(); |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.BIGSCREEN_UUID,u,3, TimeUnit.MINUTES); |
| | | String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),Constants.WxUrlParams.BISCREEN_CODE,u); |
| | | largeScreenDataVO.setQrCode(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url)); |
| | | 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(",")) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | return null; |
| | | } |
| | | @Override |
| | | public String syncHkUserOpenid(Integer id){ |
| | | return null; |
| | | } |
| | | @Override |
| | | public String dealAcsEvent(EventAcsRequest param, HttpServletResponse response){ |
| | | return null; |
| | | } |
| | |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.ext.ERPSyncService; |
| | | import com.doumee.service.business.impl.hksync.HkSyncBaseServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.HkSyncEmpowerServiceImpl; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private ERPSyncService erpSyncService; |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private DataSyncConfig dataSyncConfig; |
| | | |
| | | /** |
| | | * ç»å®æµ·åº·ç¨æ·openId |
| | | * { |
| | | * "openId" : "ovmre6R7w-vEQCHg52-UN2mV_abI", |
| | | * "userName" : "13856591439", |
| | | * "appKey" : "wx173e6caf5abc718a", |
| | | * "oaId" : "atwl", |
| | | * "platformName" : "宿³°ç©æµååº", |
| | | * |
| | | * } |
| | | */ |
| | | @Override |
| | | public String syncHkUserOpenid(Integer id){ |
| | | SystemUser user = systemUserMapper.selectById(id); |
| | | if(user == null ||StringUtils.isBlank(user.getOpenid()) ||Constants.equalsInteger(user.getOpenidHkStatus(),Constants.ONE)){ |
| | | return null; |
| | | } |
| | | UserOpenidSaveRequest request = new UserOpenidSaveRequest(); |
| | | request.setUserName(user.getUsername()); |
| | | request.setAppKey(systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode()); |
| | | request.setOaId("atwl"); |
| | | request.setOpenId(user.getOpenid()); |
| | | request.setPlatformName(user.getRealname()); |
| | | BaseResponse<Integer> response = HKService.userOpenidSave(request); |
| | | if(response!=null &&response.getCode().equals(HKConstants.RESPONSE_SUCCEE) && Constants.equalsInteger(response.getData(),Constants.ONE)){ |
| | | user.setOpenidHkStatus(Constants.ONE); |
| | | user.setOpenidHkInfo("ç»å®æå"); |
| | | }else{ |
| | | user.setOpenidHkStatus(Constants.TWO); |
| | | user.setOpenidHkInfo(response!=null?StringUtils.defaultString(response.getMsg(),"ãæªç¥å¤±è´¥åå ã"):"ç»å®å¤±è´¥"); |
| | | } |
| | | user.setOpenidHkDate(new Date()); |
| | | systemUserMapper.updateById(user); |
| | | return "æå"; |
| | | } |
| | | |
| | | /** |
| | | * åæ¥æµ·åº·ç»ç»ä¿¡æ¯,æ ¹æ®erp忥ç»ç»ç»æï¼å®æ¶æ£æ¥éè¦ä¸åå°æµ·åº·çç»ç»ä¿¡æ¯ |
| | |
| | | return; |
| | | } |
| | | Date date = new Date(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | for(Member c : list){ |
| | | dealMemberInfoBiz(c,date,path) ; |