| | |
| | | import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步门禁设备接口") |
| | | @PostMapping("/syncDevices") |
| | | // @RequiresPermissions("business:hksync:device") |
| | | @RequiresPermissions("business:hksync:device") |
| | | public ApiResponse syncHkDevices(@RequestBody AcsDeviceListRequest param) { |
| | | String result = hkSyncDeviceService.syncHkDevices(param); |
| | | return ApiResponse.success(result); |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步停车库接口") |
| | | @PostMapping("/syncParks") |
| | | // @RequiresPermissions("business:hksync:park") |
| | | @RequiresPermissions("business:hksync:park") |
| | | public ApiResponse syncHkParks(@RequestBody ParkListRequest param) { |
| | | String result = hkSyncParkService.syncHkParks(param); |
| | | return ApiResponse.success(result); |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步访客权限组接口") |
| | | @PostMapping("/syncPrivilege") |
| | | // @RequiresPermissions("business:hksync:privilege") |
| | | @RequiresPermissions("business:hksync:privilege") |
| | | public ApiResponse syncPrivilege(@RequestBody PrivilegeGroupRequest param) { |
| | | String result = hkSyncPrivilegeService.syncPrivilege(param); |
| | | return ApiResponse.success(result); |
| | |
| | | int nb = 2;//内部访客 |
| | | } |
| | | public interface VisitStatus{ |
| | | //审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败 7已签离 |
| | | //审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败 7已登记 8已签离 |
| | | int waitCheck = 0; |
| | | int submitCheck = 1; |
| | | int pass = 2; |
| | |
| | | int cancel = 4; |
| | | int xfSuccess = 5; |
| | | int xfFail = 6; |
| | | int signout = 7; |
| | | int signin= 7; |
| | | int signout = 8; |
| | | } |
| | | public interface EmpowerStatus{ |
| | | //一卡通授权下发状态 0待下发 1已下发 2下发成功 3已取消 4下发失败 5任务下载已结束 |
| | |
| | | outStream.write(buffer, 0, len); |
| | | } |
| | | // 对字节数组Base64编码 |
| | | return new BASE64Encoder().encode(outStream.toByteArray()); |
| | | return Base64.encodeBase64String(outStream.toByteArray()); |
| | | // return new BASE64Encoder().encode(outStream.toByteArray()); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String url= "http://doumeetest.oss-cn-beijing.aliyuncs.com/member/20210515/de923f81-b417-47fc-a702-472d60d7870a.png";// 待处理的图片 |
| | | String url= "http://175.27.187.84/file4/member/20223402/DM1005.png";// 待处理的图片 |
| | | String imgbese = Image2Base64(url); |
| | | System.out.println(imgbese); |
| | | System.out.println(imgbese.replace("\r\n", "")); |
| | | |
| | | // String url= "D:\\1.jpg";// 新生成的图片 |
| | | // generateImage(imgbese, url); |
| | |
| | | @TableField(exist = false) |
| | | private List<Company> childList; |
| | | |
| | | @ApiModelProperty(value = "海康部门级别路径", example = "1") |
| | | @ExcelColumn(name="海康部门级别路径") |
| | | private String hk_company_path; |
| | | @ApiModelProperty(value = "自建部门级别路径", example = "1") |
| | | @ExcelColumn(name="自建部门级别路径") |
| | | private String company_path; |
| | | @ApiModelProperty(value = "erp部门级别路径", example = "1") |
| | | @ExcelColumn(name="erp部门级别路径") |
| | | private String erp_company_path; |
| | | } |
| | |
| | | @ApiModelProperty(value = "随程人员数", example = "1") |
| | | @ExcelColumn(name="随程人员数") |
| | | private Integer memberNum; |
| | | |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "门禁有效期开始") |
| | | @ExcelColumn(name="门禁有效期开始") |
| | | private Date starttime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "门禁有效期截止") |
| | |
| | | @ApiModelProperty(value = "进厂时间") |
| | | @ExcelColumn(name="进厂时间") |
| | | private Date inDate; |
| | | |
| | | @ApiModelProperty(value = "离场时间") |
| | | @ExcelColumn(name="离场时间") |
| | | private Date outDate; |
| | |
| | | @ExcelColumn(name="接待人员") |
| | | private Integer receptMemberId; |
| | | |
| | | @ApiModelProperty(value = "审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败", example = "1") |
| | | @ExcelColumn(name="审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败") |
| | | @ApiModelProperty(value = "审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败 7拜访中 8已签离", example = "1") |
| | | @ExcelColumn(name="审核状态 0待审核 1已提交ERP审批 2审核通过 3审核不通过 4取消 5下发成功 6下发失败 7拜访中 8已签离") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "初审人编码", example = "1") |
| | |
| | | int origin =Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()); |
| | | List<Company> collect = null; |
| | | if(origin == DataSyncConfig.origin.erp){ |
| | | companies.stream().filter(s -> ( StringUtils.equals(s.getErpParentId()+"", parentId))).collect(Collectors.toList()); |
| | | collect= companies.stream().filter(s -> ( StringUtils.defaultString(s.getErpParentId(),"").equals(StringUtils.defaultString(parentId)))).collect(Collectors.toList()); |
| | | }else if(origin == DataSyncConfig.origin.hk){ |
| | | companies.stream().filter(s -> ( StringUtils.equals(s.getHkParentId()+"", parentId))).collect(Collectors.toList()); |
| | | collect= companies.stream().filter(s -> ( StringUtils.defaultString(s.getHkParentId(),"").equals(StringUtils.defaultString(parentId)))).collect(Collectors.toList()); |
| | | }else{ |
| | | companies.stream().filter(s -> ( StringUtils.equals(s.getParentId()+"", parentId))).collect(Collectors.toList()); |
| | | collect= companies.stream().filter(s -> (StringUtils.defaultString(s.getParentId()+"","").equals(StringUtils.defaultString(parentId)))).collect(Collectors.toList()); |
| | | } |
| | | |
| | | if (CollectionUtils.isEmpty(companies)){ |
| | | if (CollectionUtils.isEmpty(collect)){ |
| | | return null; |
| | | } |
| | | List<CompanyDTO> companyDTOList = new ArrayList<>(); |
| | |
| | | MPJLambdaWrapper<Member> queryWrapper = new MPJLambdaWrapper<>(); |
| | | |
| | | queryWrapper.selectAll(Member.class); |
| | | queryWrapper.selectAs(Company::getName,Member::getCompanyName); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Member::getCompanyId); |
| | | queryWrapper.in(Objects.nonNull(pageWrap.getModel().getCompanyIds())&&pageWrap.getModel().getCompanyIds().size()>0, |
| | | Member::getCompanyId,pageWrap.getModel().getCompanyIds()) |
| | |
| | | .or().like(Member::getVisitCompanyName,pageWrap.getModel().getCompanyName())) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getIdcardNo()),Member::getIdcardNo,pageWrap.getModel().getIdcardNo()) |
| | | .eq(Member::getStatus,Constants.Status.FREEZE.getValue()) |
| | | .eq(pageWrap.getModel().getCompanyId()!=null,Company::getId,pageWrap.getModel().getCompanyId()) |
| | | .eq(Objects.nonNull(pageWrap.getModel().getCode()),Member::getCode,pageWrap.getModel().getCode()) |
| | | .orderByDesc(Member::getCreateDate); |
| | | |
| | |
| | | //如果是访客登记,录入人员的在场数据记录 |
| | | retentionList.add(getRetentionModelByVisitRequest(visits,request)); |
| | | //来访时间 |
| | | updateVistis.setOutDate(DateUtil.getISO8601DateByStr(model.getStartTime())); |
| | | updateVistis.setStatus(Constants.VisitStatus.signin); |
| | | updateVistis.setInDate(DateUtil.getISO8601DateByStr(model.getStartTime())); |
| | | }else { |
| | | //如果是访客签离事件 |
| | | updateVistis.setStatus(Constants.VisitStatus.signout); |
| | | updateVistis.setOutDate(DateUtil.getISO8601DateByStr(model.getEndTime())); |
| | | updateVistis.setOutType(Constants.ZERO); |
| | | updateVistis.setOutInfo("访客正常签离"); |
| | |
| | | //人脸为空,不能进行推送 |
| | | return null; |
| | | } |
| | | request.setVisitStartTime(DateUtil.getISO8601Timestamp(c.getStarttime())); |
| | | request.setVisitEndTime(DateUtil.getISO8601Timestamp(c.getEndtime())); |
| | | request.setVisitStartTime(DateUtil.getISO8601Timestamp2(c.getStarttime())); |
| | | request.setVisitEndTime(DateUtil.getISO8601Timestamp2(c.getEndtime())); |
| | | request.setReceptionistId(c.getReceptMemberHkId());//被访人海康编码 |
| | | request.setVisitPurpose(c.getReason()); |
| | | request.setVisitorInfo(info); |
| | |
| | | info.setVisitorWorkUnit(c.getCompanyName()); |
| | | info.setPhoneNo(c.getPhone()); |
| | | info.setPlateNo(c.getCarNos()); |
| | | info.setGender(c.getSex()+""); |
| | | if(Constants.equalsInteger(c.getIdcardType(),Constants.ZERO)){ |
| | | info.setCertificateType(HKConstants.CertificateType.SHENFENZHENG.getKey()+""); |
| | | info.setCertificateNo(DESUtil.decrypt(Constants.EDS_PWD, c.getIdcardNo())); |