| | |
| | | public void run() { |
| | | try { |
| | | for(Empower c : list){ |
| | | TaskPersonDetailRequest param = new TaskPersonDetailRequest(); |
| | | AuthResultPageRequest param = new AuthResultPageRequest(); |
| | | param.setPageNo(1); |
| | | param.setPageSize(999); |
| | | param.setBusinessNo(c.getHkId()); |
| | | BaseResponse<AuthResultPageResponse> response =HKService.authResultPage(param); |
| | | |
| | | /* TaskPersonDetailRequest param = new TaskPersonDetailRequest(); |
| | | param.setPageNo(1); |
| | | param.setPageSize(10); |
| | | param.setPersonIds(new String[]{c.getMemberHkId()}); |
| | |
| | | rec.setResourceType(c.getDeviceType()); |
| | | param.setResourceInfo(rec); |
| | | //查询下发状态 |
| | | BaseResponse<TaskPersonDetailListResponse> response = HKService.taskPersoDetail(param); |
| | | BaseResponse<TaskPersonDetailListResponse> response = HKService.taskPersoDetail(param);*/ |
| | | if(response!=null |
| | | && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null |
| | | && response.getData().getList() != null |
| | | && response.getData().getList().size() > 0 |
| | | &&response.getData().getList().get(0) !=null){ |
| | | TaskPersonDetailResponse model = response.getData().getList().get(0); |
| | | if (model.getPersonDownloadDetail()!=null ) { |
| | | // TaskPersonDetailResponse model = response.getData().getList().get(0); |
| | | |
| | | AuthResultPageDetailResponse model = getAuthDetailByUserAndDevice(c,response.getData().getList()); |
| | | // if (model.getPersonDownloadDetail()!=null ) { |
| | | if (model!=null ) { |
| | | boolean isface = false;//是否人脸下发成功 |
| | | boolean iscard = false;//是否有卡片下发成功 |
| | | //更新已完成下载任务 |
| | | String remark = ""; |
| | | String cardInfo =""; |
| | | TaskPersonDetailCardFaceResponse d = model.getPersonDownloadDetail(); |
| | | if (d.getCards() != null && d.getCards().size() > 0) { |
| | | /* if (d.getCards() != null && d.getCards().size() > 0) { |
| | | for (TaskPersonDetailCardInfoResponse card : d.getCards()) { |
| | | if(StringUtils.equals(card.getErrorCode(),HKResponseCode.ReturnCode.RESPONSE_SUCCEE.getKey())){ |
| | | cardInfo += card.getId() + " "; |
| | |
| | | } |
| | | } |
| | | //如果返回下发成功 或者 人脸下发成功并且卡片下发成功 |
| | | boolean isSuccess =StringUtils.equals(model.getPersondownloadResult(), "0") || (iscard&&isface); |
| | | boolean isSuccess =StringUtils.equals(model.getPersondownloadResult(), "0") || (iscard&&isface);*/ |
| | | |
| | | if (Constants.equalsInteger(model.getDownCardStatus(),0)) { |
| | | cardInfo = "卡片下发未变更"; |
| | | }else if (Constants.equalsInteger(model.getDownCardStatus(),1)) { |
| | | cardInfo = "卡片下发成功"; |
| | | }else { |
| | | cardInfo = "卡片下发失败"; |
| | | } |
| | | |
| | | if ( Constants.equalsInteger(model.getDownFaceStatus(),0)) { |
| | | remark = "人脸下发未变更!"; |
| | | } else if (Constants.equalsInteger(model.getDownFaceStatus(),1)) { |
| | | remark = "人脸下发成功!"; |
| | | }else{ |
| | | remark = "人脸下发失败!"; |
| | | } |
| | | //下发成功或者未变更 |
| | | boolean isSuccess = Constants.equalsInteger(model.getDownPersonStatus(),1)|| Constants.equalsInteger(model.getDownPersonStatus(),0) ; |
| | | empowerMapper.update(null, new UpdateWrapper<Empower>() |
| | | .lambda() |
| | | .eq(Empower::getId, c.getId()) |
| | | .set(Empower::getRemark, remark) |
| | | .set(Empower::getRemark,cardInfo+ remark) |
| | | .set(Empower::getEditDate,new Date()) |
| | | .set(Empower::getSendInfo, remark) |
| | | .set(Empower::getSendInfo,cardInfo+remark) |
| | | .set(Empower::getSendStatus, isSuccess?Constants.EmpowerStatus.pass:Constants.EmpowerStatus.fail)); |
| | | if(isSuccess && Constants.equalsInteger(c.getMemberDeleted(), Constants.ONE)&& Constants.equalsInteger(c.getIsdeleted(), Constants.ONE) ){ |
| | | //如果是删除权限成功,检查是否删除人员 |
| | |
| | | t1.start(); |
| | | return list.get(list.size()-1).getId(); |
| | | |
| | | } |
| | | |
| | | private AuthResultPageDetailResponse getAuthDetailByUserAndDevice(Empower c, List<AuthResultPageDetailResponse> list) { |
| | | for(AuthResultPageDetailResponse t : list){ |
| | | if(StringUtils.equals(t.getPersonId(),c.getMemberHkId()) && StringUtils.equals(t.getDeviceIndexCode(),c.getDeviceIndexCode())){ |
| | | return t; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | if(list ==null || list.size()==0){ |
| | | return; |
| | | } |
| | | // clearAllEmpowerFirst(list); |
| | | // clearAllEmpowerFirst(list); |
| | | Date date = new Date(); |
| | | //创建任务 |
| | | String taskId = hkTaskAddtion(); |