|  |  | 
 |  |  | import com.doumee.core.utils.DESUtil; | 
 |  |  | import com.doumee.core.utils.DateUtil; | 
 |  |  | import com.doumee.core.utils.ImageBase64Util; | 
 |  |  | import com.doumee.core.wx.wxPlat.WxPlatConstants; | 
 |  |  | import com.doumee.core.wx.wxPlat.WxPlatNotice; | 
 |  |  | import com.doumee.dao.business.DeviceRoleMapper; | 
 |  |  | import com.doumee.dao.business.RetentionMapper; | 
 |  |  | import com.doumee.dao.business.WxNoticeConfigMapper; | 
 |  |  | import com.doumee.dao.business.join.VisitsJoinMapper; | 
 |  |  | import com.doumee.dao.business.model.DeviceRole; | 
 |  |  | import com.doumee.dao.business.model.Member; | 
 |  |  | 
 |  |  | public class HkSyncVisitServiceImpl extends HkSyncBaseServiceImpl { | 
 |  |  |     @Autowired | 
 |  |  |     private VisitsJoinMapper visitsMapper; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private WxPlatNotice wxPlatNotice; | 
 |  |  |     @Autowired | 
 |  |  |     private WxNoticeConfigMapper wxNoticeConfigMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private RetentionMapper retentionMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private SystemDictDataBiz systemDictDataBiz; | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceRoleMapper deviceRoleMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private WxPlatNotice wxPlatNotice; | 
 |  |  |     /** | 
 |  |  |      * 同步海康访客信息是否已签离状态 | 
 |  |  |      */ | 
 |  |  | 
 |  |  |                     // 对相应状态下的数据进行【已签离】处理 | 
 |  |  |                     if(!Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.signout)){ | 
 |  |  |                         Visits update = new Visits(); | 
 |  |  |                         //已失效 | 
 |  |  |                         //已签离 | 
 |  |  |                         update.setStatus(Constants.VisitStatus.signout); | 
 |  |  |                         update.setEditDate(date); | 
 |  |  |                         update.setId(c.getId()); | 
 |  |  |                         update.setInDate(DateUtil.getISO8601DateByStr2(data.getVisitStartTime())); | 
 |  |  |                         update.setOutDate(DateUtil.getISO8601DateByStr2(data.getVisitEndTime())); | 
 |  |  |                         update.setOutInfo(model.getVisitorStatus().equals(5)?"过期自动签离":"查询已签离"); | 
 |  |  |                         update.setRemark("已签离"); | 
 |  |  |                         visitsMapper.updateById(update); | 
 |  |  |  | 
 |  |  | 
 |  |  | //                getUpdateModelByResponse(c,date,roleList,path); | 
 |  |  |                 getUpdateModelByResponseIccm(c,date,roleList,path); | 
 |  |  |                 visitsMapper.updateById(c); | 
 |  |  |                 //给申请人发送微信公众号 下发权限失败 | 
 |  |  |                 if(StringUtils.isNotBlank(c.getOpenid()) && Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.xfFail)){ | 
 |  |  |                     wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, | 
 |  |  |                             wxNoticeConfigMapper,c, WxPlatConstants.visitContent.visitApplyHkFail, | 
 |  |  |                             systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), | 
 |  |  |                             Arrays.asList(c.getOpenid().split(",")) | 
 |  |  |                     ); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  | 
 |  |  |                     && response.getData().getAppointmentInfoList() !=null | 
 |  |  |                     && response.getData().getAppointmentInfoList().size()>0)){ | 
 |  |  |                 id =response.getData().getAppointmentInfoList().get(0).getOrderId(); | 
 |  |  |                 qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode(); | 
 |  |  |                 qrcode =response.getData().getAppointmentInfoList().get(0).getVerificationCode(); | 
 |  |  | //                qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode(); | 
 |  |  |             } | 
 |  |  |             reson = response!=null?JSONObject.toJSONString(response):""; | 
 |  |  |         }else{ | 
 |  |  | 
 |  |  |                     && response.getData().getAppointmentInfoList() !=null | 
 |  |  |                     && response.getData().getAppointmentInfoList().size()>0)){ | 
 |  |  |                 id =response.getData().getOrderId(); | 
 |  |  |                 qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode(); | 
 |  |  | //                qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode(); | 
 |  |  |                 qrcode =response.getData().getAppointmentInfoList().get(0).getVerificationCode(); | 
 |  |  |             } | 
 |  |  |             reson = response!=null?JSONObject.toJSONString(response):""; | 
 |  |  |         }else{ |