using AutoMapper; using LinqKit; using Ropin.Inspection.Common.Accessor.Interface; using Ropin.Inspection.Model; using Ropin.Inspection.Model.Entities; using Ropin.Inspection.Model.SearchModel; using Ropin.Inspection.Model.ViewModel; using Ropin.Inspection.Repository; using Ropin.Inspection.Repository.Interface; using Ropin.Inspection.Service.Interface; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace Ropin.Inspection.Service { public class TispSpotService : ITispSpotService { private readonly ITispSpotRepository _repository; private readonly ITispSpotContentRepository _tispSpotContentRepository; private readonly ITispContentRepository _tispContentRepository; private readonly ITmtnSpotDevOpsContentRepository _tmtnSpotDevOpsContentRepository; private readonly ITmtnDevOpsContentRepository _tmtnDevOpsContentRepository; private readonly ITispSpotUserRepository _tispSpotUserRepository; private readonly ITprdProductService _tprdProductService; private readonly IUnitOfWork _unitOfWork; private readonly ITdevDevSpotRepository _tdevDevSpotRepository; private readonly IMapper _mapper; private readonly IClaimsAccessor _claims; private readonly ITispRecordItemRepository _tispRecordItemRepository; public TispSpotService( ITispRecordItemRepository tispRecordItemRepository, IClaimsAccessor claims, ITprdProductService tprdProductService, ITispSpotRepository repository, ITispSpotContentRepository tispSpotContentRepository, ITispSpotUserRepository tispSpotUserRepository, ITmtnSpotDevOpsContentRepository tmtnSpotDevOpsContentRepository, ITmtnDevOpsContentRepository tmtnDevOpsContentRepository, ITispContentRepository tispContentRepository, ITdevDevSpotRepository tdevDevSpotRepository, IUnitOfWork unitOfWork, IMapper mapper) { _claims = claims; _repository = repository; _tispSpotContentRepository = tispSpotContentRepository; _tispSpotUserRepository = tispSpotUserRepository; _tprdProductService = tprdProductService; _tispRecordItemRepository = tispRecordItemRepository; _tispContentRepository = tispContentRepository; _tmtnDevOpsContentRepository = tmtnDevOpsContentRepository; _tdevDevSpotRepository = tdevDevSpotRepository; _unitOfWork = unitOfWork; _mapper = mapper; _tmtnSpotDevOpsContentRepository = tmtnSpotDevOpsContentRepository; } public async Task CreateOneAsync(TispSpotViewModel viewModel) { var spot = _mapper.Map(viewModel); spot.C_CreateBy = _claims.ApiUserId; spot.D_CreateOn = DateTime.Now; spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; _repository.Create(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("创建失败"); } } public async Task CreateOneAsync(TispSpotCreateViewModel viewModel) { var spot = _mapper.Map(viewModel); spot.C_CreateBy = _claims.ApiUserId; spot.D_CreateOn = DateTime.Now; spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; spot.C_Status = "1"; _repository.Create(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("创建失败"); } if (null != viewModel.contentIdList) { foreach (Guid contentId in viewModel.contentIdList) { TISP_SpotContent spotContent = new TISP_SpotContent(); spotContent.C_SpotCode = spot.C_Code; spotContent.C_ContentCode = contentId; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; //spotContent.C_LastUpdatedBy = _claims.ApiUserId; //spotContent.D_LastUpdatedOn = DateTime.Now; //spotContent.C_Status = '1'; _tispSpotContentRepository.Create(spotContent); var resultSpotContent = await _repository.SaveAsync(); if (!resultSpotContent) { throw new Exception("创建失败"); } } } if (null != viewModel.devOpsContentIdList) { foreach (string contentId in viewModel.devOpsContentIdList) { TMTN_SpotDevOpsContent spotContent = new TMTN_SpotDevOpsContent(); spotContent.C_SpotCode = spot.C_Code.ToString(); spotContent.C_ID = Guid.NewGuid().ToString(); spotContent.C_DevOpsContentCode = contentId; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; spotContent.C_Status ="1"; _tmtnSpotDevOpsContentRepository.Create(spotContent); var resultSpotContent = await _tmtnSpotDevOpsContentRepository.SaveAsync(); if (!resultSpotContent) { throw new Exception("创建失败"); } } } } public async Task CreateOneByDevAsync(TispSpotByDevCreateViewModel viewModel) { var result = false; _unitOfWork.BeginTransaction(); try { var spot = _mapper.Map(viewModel); spot.C_CreateBy = _claims.ApiUserId; spot.D_CreateOn = DateTime.Now; spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; spot.C_Status = "1"; result = await _unitOfWork.RegisterNew(spot); //_repository.Create(spot); //result = await _repository.SaveAsync(); if (!result) { throw new Exception("创建失败"); } var devSpot = new TDEV_DevSpot(); devSpot.C_ID = Guid.NewGuid().ToString(); devSpot.C_SpotCode = spot.C_Code.ToString(); devSpot.C_DevStoreCode = viewModel.C_DevStoreCode; devSpot.C_CreateBy = _claims.ApiUserId; devSpot.D_CreateOn = DateTime.Now; //content.C_Status = "1"; result = await _unitOfWork.RegisterNew(devSpot); //result = await _tdevDevSpotRepository.SaveAsync(); if (!result) { throw new Exception("创建失败"); } string storeCode = string.Empty; List contentList=null; List devOpsContentList=null; if (null != viewModel.contentList) { contentList = _mapper.Map>(viewModel.contentList); foreach (var item in contentList) { item.C_ID = Guid.NewGuid(); item.C_CreateBy = _claims.ApiUserId; item.D_CreateOn = DateTime.Now; item.C_Status = "1"; item.I_Sort = item.I_Sort; storeCode = item.C_StoreCode; } //result = await _unitOfWork.RegisterRangeNew(contentList); } if (null != viewModel.devOpsContentList) { devOpsContentList = _mapper.Map>(viewModel.devOpsContentList); foreach (var item in devOpsContentList) { item.C_ID = item.C_ID; item.C_CreateBy = _claims.ApiUserId; item.D_CreateOn = DateTime.Now; item.C_Status = "1"; storeCode = item.C_StoreCode; } //result = await _unitOfWork.RegisterRangeNew(devOpsContentList); } if (!storeCode.Equals(string.Empty)) { if (contentList != null) { List haveContentList = _mapper.Map>(contentList); IEnumerable allContentList = await _tispContentRepository.GetByConditionAsync(x => x.C_StoreCode == storeCode); var allList = allContentList.ToList(); List otherContentList = new List(); if (allList.Any()) { foreach (var content in contentList) { var item = allList.Where(x => x.C_Name == content.C_Name).FirstOrDefault(); if(item != null) otherContentList.Add(item); } } //otherContentList = allList.Where(x=>x.C_Name == ) //haveContentList?.RemoveAll(x => contentList.Select(y => y.C_Name).Contains(x.C_Name)); //otherContentList = allList.Intersect(contentList).ToList(); //contentList?.RemoveAll(x => allContentList.ToList().Select(y => y.C_ID).Contains(x.C_ID)); contentList?.RemoveAll(x => allList.Select(y => y.C_Name).Contains(x.C_Name)); await _unitOfWork.RegisterRangeNew(contentList.ToList()); foreach (var content in contentList) { TISP_SpotContent spotContent = new TISP_SpotContent(); spotContent.C_SpotCode = spot.C_Code; spotContent.C_ContentCode = content.C_ID; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; result = await _unitOfWork.RegisterNew(spotContent); if (!result) { throw new Exception("创建失败"); } } foreach (var content in otherContentList) { TISP_SpotContent spotContent = new TISP_SpotContent(); spotContent.C_SpotCode = spot.C_Code; spotContent.C_ContentCode = content.C_ID; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; result = await _unitOfWork.RegisterNew(spotContent); if (!result) { throw new Exception("创建失败"); } } } if (devOpsContentList != null) { foreach (var content in devOpsContentList) { TMTN_SpotDevOpsContent spotContent = new TMTN_SpotDevOpsContent(); spotContent.C_SpotCode = spot.C_Code.ToString(); spotContent.C_ID = Guid.NewGuid().ToString(); spotContent.C_DevOpsContentCode = content.C_ID; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; spotContent.C_Status = "1"; result = await _unitOfWork.RegisterNew(spotContent); if (!result) { throw new Exception("创建失败"); } } IEnumerable allContentList = await _tmtnDevOpsContentRepository.GetByConditionAsync(x => x.C_StoreCode == storeCode); devOpsContentList?.RemoveAll(x => allContentList.ToList().Select(y => y.C_ID).Contains(x.C_ID)); await _unitOfWork.RegisterRangeNew(devOpsContentList); } //var allInContentList = contentList == null ? null:contentList?.Union(devOpsContentList).ToList(); //IEnumerable allContentList = await _tispContentRepository.GetByConditionAsync(x => x.C_StoreCode == storeCode); ////var isexsist = allContentList.ToList()?.Except(allInContentList).Distinct().ToList(); //allInContentList?.RemoveAll(x => allContentList.ToList().Select(y => y.C_ID).Contains(x.C_ID)); //result = await _unitOfWork.RegisterRangeNew(allInContentList); } } catch (Exception ex) { result = false; throw new Exception("创建失败"); } finally { if (result) await _unitOfWork.CommitAsync(); else _unitOfWork.Rollback(); } //var result = false; //_unitOfWork.BeginTransaction(); //try //{ // var spot = _mapper.Map(viewModel); // spot.C_CreateBy = _claims.ApiUserId; // spot.D_CreateOn = DateTime.Now; // spot.C_LastUpdatedBy = _claims.ApiUserId; // spot.D_LastUpdatedOn = DateTime.Now; // spot.C_Status = "1"; // _repository.Create(spot); // result = await _repository.SaveAsync(); // if (!result) // { // throw new Exception("创建失败"); // } // var devSpot = new TDEV_DevSpot(); // devSpot.C_ID = Guid.NewGuid().ToString(); // devSpot.C_SpotCode = spot.C_Code.ToString(); // devSpot.C_DevStoreCode = viewModel.C_DevStoreCode; // devSpot.C_CreateBy = _claims.ApiUserId; // devSpot.D_CreateOn = DateTime.Now; // //content.C_Status = "1"; // _tdevDevSpotRepository.Create(devSpot); // result = await _tdevDevSpotRepository.SaveAsync(); // if (!result) // { // throw new Exception("创建失败"); // } // if (null != viewModel.contentList) // { // IList contentList = _mapper.Map>(viewModel.contentList); // foreach (var item in contentList) // { // item.C_ID = item.C_ID; // item.C_CreateBy = _claims.ApiUserId; // item.D_CreateOn = DateTime.Now; // item.C_Status = "1"; // } // await _tispContentRepository.CreateRangeAsync(contentList); // } // if (null != viewModel.devOpsContentList) // { // IList devOpsContentList = _mapper.Map>(viewModel.devOpsContentList); // foreach (var item in devOpsContentList) // { // item.C_ID = item.C_ID; // item.C_CreateBy = _claims.ApiUserId; // item.D_CreateOn = DateTime.Now; // item.C_Status = "1"; // } // await _tispContentRepository.CreateRangeAsync(devOpsContentList); // } //} //catch (Exception ex) //{ // throw new Exception("创建失败"); //} //finally //{ // if (result) // await _unitOfWork.CommitAsync(); // else // _unitOfWork.Rollback(); //} } public async Task DeleteAsync(Guid id) { var spot = await _repository.GetByIdAsync(id); if (spot == null) { throw new Exception("没有此数据"); } spot.C_Status = "0"; spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; _repository.Update(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("删除失败"); } } public async Task> GetAllAsync() { var pagedList = await _repository.GetAllAsync(); var spotDtoList = _mapper.Map>(pagedList); return spotDtoList.ToList(); } public async Task GetSpotByQRCodeAsync(string qRCode, string storeCode) { TispSpotViewModel spotDto = await _repository.GetSpotByQRCodeAsync(qRCode, storeCode); if (null == spotDto) { return null; } //int iResult = await _tispSpotUserRepository.GetBySpotIdAndUserIdAsync(spotDto.C_Code, _claims.ApiUserId); //if (iResult <= 0 && _claims.RoleIds.Contains("巡检员")) //{ // throw new Exception("此巡检点没有分配给您!"); //} var spotContent = _tispSpotContentRepository.GetBySpotCodeAsync(spotDto.C_Code); List spotContentDtoList = _mapper.Map>(spotContent.Where(x=>x.C_StoreCode == storeCode).ToList()).ToList(); var devOpsContent = _tmtnSpotDevOpsContentRepository.GetBySpotCodeAsync(spotDto.C_Code.ToString()); List devOpsContentList = _mapper.Map>(devOpsContent.Where(x => x.C_StoreCode == storeCode).ToList()).ToList(); for (int i= spotContentDtoList.Count-1; i>=0 ;i--) { var iCount = await _tispRecordItemRepository.GetContentAlarmCout(spotContentDtoList[i].C_ID, spotDto.C_Code); if (iCount > 0 ) { spotContentDtoList.Remove(spotContentDtoList[i]); } } spotDto.ContentList = spotContentDtoList; spotDto.DevOpsContentList = devOpsContentList; return spotDto; //var spot = await _repository.GetSpotContentsByQRCodeAsync(qRCode); //return spot.FirstOrDefault(); } public async Task GetSpotProductByQRCodeTAsync(string qRCode, string storeCode) { TispSpotViewModel spotDto = await _repository.GetSpotByQRCodeAsync(qRCode, storeCode); IEnumerable products; if (null == spotDto) { products = await _tprdProductService.GetConditionAsync(new TprdProductSearchModel { C_QRCode = qRCode,C_StoreCode = storeCode }); }else { products = await _tprdProductService.GetConditionAsync(new TprdProductSearchModel { C_SpotCode =spotDto.C_Code.ToString() }); } spotDto.ProductList = products; return spotDto; } public async Task GetDevStoreByQRCodeAsync(string qRCode, string storeCode) { TispSpotDevStoreViewModel spotDto = await _repository.GetDevStoreByQRCodeAsync(qRCode, storeCode); return spotDto; } public Task> GetByConditionAsync(Expression> expression) { throw new NotImplementedException(); } public async Task> GetSpotsConditionAsync(TispSpotSearchModel searchModel) { var predicate = PredicateBuilder.New(true);//查询条件,推荐后台使用这种方式灵活筛选 #region 添加条件查询 //predicate = predicate.And(i => i.C_Status.Equals("1")); predicate.And(i => i.C_StoreCode.Equals(searchModel.C_StoreCode)); if (!string.IsNullOrEmpty(searchModel.C_Name)) { predicate = predicate.And(i => i.C_Name.Contains(searchModel.C_Name)); } if (!string.IsNullOrEmpty(searchModel.C_Status)) { predicate = predicate.And(i => i.C_Status.Equals(searchModel.C_Status)); } if (!string.IsNullOrEmpty(searchModel.C_Number)) { predicate = predicate.And(i => i.C_Number.Equals(searchModel.C_Number)); } if (!string.IsNullOrEmpty(searchModel.C_Position)) { predicate = predicate.And(i => i.C_Position.Equals(searchModel.C_Position)); } if (!string.IsNullOrEmpty(searchModel.C_QRCode)) { predicate = predicate.And(i => i.C_QRCode.Equals(searchModel.C_QRCode)); } if (!string.IsNullOrEmpty(searchModel.C_AreaCode)) { predicate = predicate.And(i => i.C_AreaCode.Equals(searchModel.C_AreaCode)); } #endregion var list = await _repository.GetPageAsync(predicate, "-D_CreateOn", searchModel.IsPagination, searchModel.PageIndex, searchModel.PageSize); searchModel.TotalCount = list.Totals; var dtoList = _mapper.Map, List>(list.Rows); return dtoList; } public async Task> GetSpotsConditionNoDevSpotRepeatAsync(TispSpotSearchModel searchModel) { // _tdevDevSpotRepository--------- var predicate = PredicateBuilder.New(true);//查询条件,推荐后台使用这种方式灵活筛选 var devSpotList = _tdevDevSpotRepository.GetAll(); var SpotCode = devSpotList.Select(t=>t.C_SpotCode); #region 添加条件查询 //predicate = predicate.And(i => i.C_Status.Equals("1")); predicate.And(i => i.C_StoreCode.Equals(searchModel.C_StoreCode)); if (!string.IsNullOrEmpty(searchModel.C_Name)) { predicate = predicate.And(i => i.C_Name.Contains(searchModel.C_Name)); } if (!string.IsNullOrEmpty(searchModel.C_Status)) { predicate = predicate.And(i => i.C_Status.Equals(searchModel.C_Status)); } if (!string.IsNullOrEmpty(searchModel.C_Number)) { predicate = predicate.And(i => i.C_Number.Equals(searchModel.C_Number)); } if (!string.IsNullOrEmpty(searchModel.C_Position)) { predicate = predicate.And(i => i.C_Position.Equals(searchModel.C_Position)); } if (!string.IsNullOrEmpty(searchModel.C_QRCode)) { predicate = predicate.And(i => i.C_QRCode.Equals(searchModel.C_QRCode)); } if (!string.IsNullOrEmpty(searchModel.C_AreaCode)) { predicate = predicate.And(i => i.C_AreaCode.Equals(searchModel.C_AreaCode)); } #endregion predicate=predicate.And(i=> !SpotCode.Contains(i.C_Code.ToString())); var list = await _repository.GetPageAsync(predicate, "-D_CreateOn", searchModel.IsPagination, searchModel.PageIndex, searchModel.PageSize); searchModel.TotalCount = list.Totals; var dtoList = _mapper.Map, List>(list.Rows); return dtoList; } public async Task GetByIdAsync(Guid id) { var spot = await _repository.GetByIdAsync(id); if (null == spot) { return null; } var spotDto = _mapper.Map(spot); var spotContent = _tispSpotContentRepository.GetBySpotCodeAsync(id); IEnumerable spotContentDtoList = _mapper.Map>(spotContent.Where(x=>x.C_StoreCode ==spot.C_StoreCode).ToList()); spotDto.ContentList = spotContentDtoList; var spotDevOpsContent = _tmtnSpotDevOpsContentRepository.GetBySpotCodeAsync(id.ToString()); IEnumerable spotDevOpsContentList = _mapper.Map>(spotDevOpsContent.Where(x => x.C_StoreCode == spot.C_StoreCode).ToList()); spotDto.DevOpsContentList = spotDevOpsContentList; return spotDto; } public Task IsExistAsync(Guid id) { throw new NotImplementedException(); } public async Task UpdateAsync(Guid id, TispSpotUpdateViewModel updateModel) { var spot = await _repository.GetByIdAsync(id); if (spot == null) { throw new Exception("没有此点"); } spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; _mapper.Map(updateModel, spot, typeof(TispSpotUpdateViewModel), typeof(TISP_Spot)); _repository.Update(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("更新失败"); } if (null != updateModel.contentIdList) { //删除 await _tispSpotContentRepository.DeleteBySpotIdAsync(id); foreach (Guid contentId in updateModel.contentIdList) { TISP_SpotContent spotContent = new TISP_SpotContent(); spotContent.C_SpotCode = id; spotContent.C_ContentCode = contentId; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; //spotContent.C_LastUpdatedBy = _claims.ApiUserId; //spotContent.D_LastUpdatedOn = DateTime.Now; //spotContent.C_Status = '1'; _tispSpotContentRepository.Create(spotContent); var resultSpotContent = await _repository.SaveAsync(); if (!resultSpotContent) { throw new Exception("创建失败"); } } } if (null != updateModel.devOpsContentIdList) { await _tmtnSpotDevOpsContentRepository.DeleteBySpotIdAsync(id.ToString()); foreach (string contentId in updateModel.devOpsContentIdList) { TMTN_SpotDevOpsContent spotContent = new TMTN_SpotDevOpsContent(); spotContent.C_SpotCode = id.ToString(); spotContent.C_ID = Guid.NewGuid().ToString(); spotContent.C_DevOpsContentCode = contentId; spotContent.C_CreateBy = _claims.ApiUserId; spotContent.D_CreateOn = DateTime.Now; spotContent.C_Status = "1"; _tmtnSpotDevOpsContentRepository.Create(spotContent); var resultSpotContent = await _tmtnSpotDevOpsContentRepository.SaveAsync(); if (!resultSpotContent) { throw new Exception("创建失败"); } } } } public async Task UpdateConfigureSpotAsync(Guid id, TispSpotConfigureUpdateViewModel updateModel) { var spot = await _repository.GetByIdAsync(id); if (spot == null) { throw new Exception("没有此巡检点"); } //if(!string.IsNullOrEmpty(spot.C_QRCode) && !spot.C_QRCode.Equals(updateModel.C_QRCode)) //{ // var spotTwo = await GetSpotsConditionAsync(new TispSpotSearchModel { C_QRCode = updateModel.C_QRCode, C_StoreCode = spot.C_StoreCode }); // if (spotTwo != null) // { // throw new Exception("此二维码已经分配给了巡检点"); // } //} if (!string.IsNullOrEmpty(spot.C_QRCode) && spot.C_QRCode.Equals(updateModel.C_QRCode)) { } else { //if(!string.IsNullOrEmpty(spot.C_QRCode) && !spot.C_QRCode.Equals(updateModel.C_QRCode)) //{ var spotTwo = await GetSpotsConditionAsync(new TispSpotSearchModel { C_QRCode = updateModel.C_QRCode, C_StoreCode = spot.C_StoreCode }); if (spotTwo.Any()) { throw new Exception("此二维码已经分配给了巡检点"); } //} } spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; if(!string.IsNullOrEmpty(updateModel.C_ImageUrl)) spot.C_ImageUrl = updateModel.C_ImageUrl; if (updateModel.IsUpdateGPS) { spot.C_GPS = updateModel.C_GPS; } spot.C_QRCode = updateModel.C_QRCode; spot.I_Offset = updateModel.I_Offset; _repository.Update(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("更新失败"); } } public async Task UpdateSpotImageAsync(Guid id, string imageUrl) { var spot = await _repository.GetByIdAsync(id); if (spot == null) { throw new Exception("没有此巡检点"); } spot.C_LastUpdatedBy = _claims.ApiUserId; spot.D_LastUpdatedOn = DateTime.Now; if (!string.IsNullOrEmpty(imageUrl)) spot.C_ImageUrl = imageUrl; _repository.Update(spot); var result = await _repository.SaveAsync(); if (!result) { throw new Exception("更新失败"); } } public Task UpdateOneAsync(TispSpotViewModel viewModel, params string[] fields) { throw new NotImplementedException(); } //public async Task UpdateOneAsync(TispSpotViewModel viewModel, params string[] fields) //{ // var user = await _repository.GetByIdAsync(id); // if (user == null) // { // throw new Exception("没有此用户"); // } // user.C_LastUpdatedBy = new Guid("62D5B5F5-3008-49B7-B0D6-CC337F1A3330"); // user.D_LastUpdatedOn = DateTime.Now; // _mapper.Map(updateUser, user, typeof(TsysUserUpdateViewModel), typeof(TSYS_User)); // _repository.Update(user); // var result = await _repository.SaveAsync(); // if (!result) // { // throw new Exception("更新用户失败"); // } //} public Task UpdateUserAsync(Guid id, TispSpotUpdateViewModel updateUser) { throw new NotImplementedException(); } } }