| | |
| | | @ApiModelProperty(value = "微信openid", example = "1", hidden = true) |
| | | private String openid; |
| | | |
| | | //2024年12月6日11:00:30 类型 0司机人员 1普通访客 2内部人员 |
| | | @ApiModelProperty(value = "类型 0平台用户 1访客", example = "0") |
| | | private Integer type; |
| | | |
| | |
| | | if (user == null) { |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); |
| | | } |
| | | //注册司机/劳务人员 |
| | | if((Constants.equalsInteger(user.getType(),Constants.ZERO)||Constants.equalsInteger(user.getType(),Constants.TWO)) && Objects.nonNull(user.getMemberId())){ |
| | | if(Constants.equalsInteger(user.getType(),Constants.TWO)){ |
| | | if(Objects.isNull(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN); |
| | | } |
| | | Company company = companyMapper.selectById(user.getCompanyId()); |
| | | if(Objects.isNull(company) || Constants.equalsInteger(company.getType(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN); |
| | | } |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN); |
| | | } |
| | | |
| | | |
| | | String pwd = Utils.Secure.encryptPassword(new String(dto.getPassword()), user.getSalt()); |
| | | // 比较密码 |
| | | if( !StringUtils.equals(pwd, user.getPassword())){ |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.FacePictureCheckRequest; |
| | | import com.doumee.core.haikang.model.param.respose.FacePictureCheckResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | /** |
| | |
| | | @ApiOperation(value = "上传文件到FTP") |
| | | @RequestMapping(method= RequestMethod.POST,value="upload") |
| | | @ResponseBody |
| | | public void upload(HttpServletRequest request, HttpServletResponse response, String folder) throws Exception { |
| | | public void upload(HttpServletRequest request, HttpServletResponse response, String folder,Integer isFace) throws Exception { |
| | | // folder = systemDictDataBiz.queryByCode(Constants.FTP,folder).getCode(); |
| | | String prefixPath = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode(); |
| | | InputStream is = null; |
| | |
| | | String fileName = folder+fName; |
| | | boolean r = ftp.uploadInputstream(is,fileName); |
| | | if(r){ |
| | | if(Constants.equalsInteger(isFace,Constants.ZERO)){ |
| | | //验证人脸评分 |
| | | //人脸评分 |
| | | 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 + fileName); |
| | | BaseResponse<FacePictureCheckResponse> responseBaseResponse = HKService.facePictureCheck(param); |
| | | if(responseBaseResponse == null || !StringUtils.equals(responseBaseResponse.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = responseBaseResponse.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()); |
| | | } |
| | | } |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | | context.put("errno",0); |
| | |
| | | @ApiOperation("访客记录 - 分页列表") |
| | | @PostMapping("/visitPage") |
| | | public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap) { |
| | | if(Objects.isNull(pageWrap.getModel().getMemberId())){ |
| | | pageWrap.getModel().setMemberId(0); |
| | | } |
| | | return ApiResponse.success(visitsService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.FacePictureCheckRequest; |
| | | import com.doumee.core.haikang.model.param.respose.FacePictureCheckResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | |
| | | @ApiOperation(value = "上传文件到FTP") |
| | | @RequestMapping(method= RequestMethod.POST,value="uploadFtp.do",headers = "content-type=multipart/form-data") |
| | | @ResponseBody |
| | | public void uploadFtp(HttpServletRequest request, HttpServletResponse response, String folderCode) throws Exception { |
| | | public void uploadFtp(HttpServletRequest request, HttpServletResponse response, String folderCode,Integer isFace) throws Exception { |
| | | System.out.println("上传中"); |
| | | String folder = systemDictDataBiz.queryByCode(Constants.FTP,folderCode).getCode(); |
| | | String prefixPath = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode(); |
| | |
| | | // boolean r = ftp.uploadInputstream(compressImg(is),fileName); |
| | | boolean r = ftp.uploadInputstream(is,fileName); |
| | | if(r){ |
| | | if(Constants.equalsInteger(isFace,Constants.ZERO)){ |
| | | //验证人脸评分 |
| | | //人脸评分 |
| | | 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 + 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(), "对不起,人脸评分获取数据失败~"); |
| | | } |
| | | FacePictureCheckResponse facePictureCheckResponse = responseBaseResponse.getData(); |
| | | if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | throw new BusinessException(com.doumee.core.constants.ResponseStatus.SERVER_ERROR.getCode(), "对不起,人脸评分获取数据失败~"); |
| | | } |
| | | if(!facePictureCheckResponse.getCheckResult()){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | } |
| | | } |
| | | |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | | context.put("errno",0); |
| | |
| | | } |
| | | WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO(); |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | if(StringUtils.isBlank(openId)){ |
| | | return wxAuthorizeVO; |
| | | } |
| | | if(source==1){ |
| | | //根据openId 查询用户信息 |
| | | Member member = memberJoinMapper.selectJoinOne(Member.class,new MPJLambdaWrapper<Member>() |
| | |
| | | .last(" limit 1 ")); |
| | | //非访客用户 进行判断是否存在用户 |
| | | if(!Objects.isNull(user)){ |
| | | Member member = memberMapper.selectById(user.getId()); |
| | | Member member = memberMapper.selectById(user.getMemberId()); |
| | | if(member.getIsdeleted() == Constants.ONE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已删除,请联系管理员"); |
| | | } |
| | |
| | | } |
| | | if(memberMapper.selectCount(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .ne(Member::getType,Constants.memberType.visitor) |
| | | .eq(Member::getPhone,registerDriverDTO.getPhone()) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"手机号已注册!"); |
| | |
| | | Member member = new Member(); |
| | | member.setCreateDate(new Date()); |
| | | member.setIsdeleted(Constants.ZERO); |
| | | member.setType(Constants.THREE); |
| | | member.setType(Constants.memberType.driver); |
| | | member.setName(registerDriverDTO.getName()); |
| | | member.setPhone(registerDriverDTO.getPhone()); |
| | | member.setStatus(Constants.ZERO); |
| | |
| | | systemUser.setSalt(salt); |
| | | systemUser.setPassword(member.getPassward()); |
| | | systemUser.setStatus(Constants.ZERO); |
| | | systemUser.setType(Constants.memberType.driver); |
| | | systemUser.setSource(Constants.TWO); |
| | | systemUserMapper.insert(systemUser); |
| | | |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转!"); |
| | | } |
| | | |
| | | Platform platform = platformJoinMapper.selectById(jobOperateDTO.getPlatformId()); |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.isNull(platform)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到月台信息"); |
| | | } |
| | |
| | | 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_RESOURCE_PATH).getCode() + |
| | | 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); |
| | |
| | | |
| | | //在园长期相关方人数 |
| | | pcWorkPlatformDataVO.setInParkLwUserNum( |
| | | retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count() |
| | | retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) |
| | | && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count() |
| | | ); |
| | | pcWorkPlatformDataVO.setLwUserInNum(Constants.ZERO); |
| | | pcWorkPlatformDataVO.setLwUserOutNum(Constants.ZERO); |
| | |
| | | List<Integer> companyIds = companyList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<Retention> retentionList = retentionMapper.selectList( |
| | | new QueryWrapper<Retention>().lambda() |
| | | .eq(Retention::getType,Constants.TWO) |
| | | .in(Retention::getCompanyId,companyIds) |
| | | ); |
| | | for (Company company:companyList) { |