/// <summary> /// 原先crm接口黑名单过滤+获取重复数据接口GetInfoByCamera /// </summary> /// <param name="licenseNo"></param> /// <param name="agent"></param> /// <param name="childAgent"></param> /// <param name="custKey"></param> /// <param name="cityCode"></param> /// <param name="renewalCarType"></param> /// <returns></returns> public CameraBackDataViewModel GetFiterData(string licenseNo, int agent, int childAgent, string custKey, int cityCode, int renewalCarType, int repeatStatus, int roleType) { bool isAdmin = (roleType == 3 || roleType == 4); CameraBackDataViewModel model = new CameraBackDataViewModel(); try { //黑名单过滤 bx_camera_blacklist blackmodel = _cameraDistributeRespository.GetCameraBlack(agent, childAgent, licenseNo); if (blackmodel != null && blackmodel.Id > 0) { model.IsBlack = true; } else { model.IsBlack = false; } //根据重复报价设置来获取老数据 bx_userinfo userInfo = null; if (repeatStatus == 0 || repeatStatus == 1) { List <bx_userinfo> userInfoList = GetUserinfoByLicenseAndAgent(agent, licenseNo); if (userInfoList.Count > 0) { userInfo = userInfoList.FirstOrDefault(); } } else if (repeatStatus == 2) { List <bx_userinfo> userInfoList = new List <bx_userinfo>(); if (!isAdmin) { userInfoList = GetUserinfoByLicenseAndAgent(childAgent, licenseNo); } else { userInfoList = GetUserinfoByLicenseAndAgent(agent, licenseNo); } if (userInfoList.Count > 0) { userInfo = userInfoList.FirstOrDefault(); } } if (userInfo != null) { model.Buid = userInfo.Id.ToString(); model.Agent = userInfo.Agent; model.OpenId = userInfo.OpenId; } } catch (Exception ex) { logInfo.Error("摄像头进店>>>根据摄像头获取信息:", ex); } return(model); }
public bx_camera_blacklist GetCameraBlack(int agent, int childAgent, string LicenseNo) { bx_camera_blacklist response = db.bx_camera_blacklist.Where(x => x.agent_id == childAgent && x.license_no == LicenseNo && x.IsDelete == 0).FirstOrDefault(); return(response); }