//志愿者参与的志愿活动(已结束和进行中)(必须有签到记录) 参数 志愿者VID public List <VolunteerActivitySearchMiddle> GetMyAllActivity(string VID) { List <String> Infos = _IVA_SignRepository.GetMyList(VID); List <VolunteerActivitySearchMiddle> Searches = new List <VolunteerActivitySearchMiddle>(); foreach (var item in Infos) { VolunteerActivity middle = new VolunteerActivity(); middle = _IVolunteerActivityRepository.GetByID(item.ToString()); var SearchMiddlecs = _IMapper.Map <VolunteerActivity, VolunteerActivitySearchMiddle>(middle); Searches.Add(SearchMiddlecs); } return(Searches); }
//获取当前用户 今天以后的报名活动情况 日期列表 public List <string> GetMyAllDate(SearchByVIDModel vidModel) { List <string> list = new List <string>(); //获取我的报名活动情况 List <string> Infos = _IVA_SignRepository.GetMyList(vidModel.VID); List <VolunteerActivitySearchMiddle> Searches = new List <VolunteerActivitySearchMiddle>(); List <VolunteerActivity> middle = _IVolunteerActivityRepository.GetByIDList(Infos); Searches = _IMapper.Map <List <VolunteerActivity>, List <VolunteerActivitySearchMiddle> >(middle); //获取当前用户 今天以后的报名活动情况 日期列表 //如果签退时间在活动结束之后 则需要按照 签退时间 判断 Searches = Searches.Where(o => (o.SignOutEtime == null && o.Etime >= DateTime.Now) || (o.SignOutEtime != null && o.SignOutEtime >= DateTime.Now)).OrderBy(o => o.Stime).ToList(); foreach (var item in Searches) { //查看是否已经完结事件 bak3 显示 该用户针对活动的状态 var handle = _Va_HandleRepository.GetNewSign(vidModel.VID, item.ID); if (handle != null && handle.ID != null) { if (handle.type == "in") { item.bak3 = "上传现场图片"; } if (handle.type == "img") { item.bak3 = "待签退"; } if (handle.type == "out") { item.bak3 = "已完结"; } } else { item.bak3 = "待签到"; } if (item.bak3 != "已完结") { string date = DateTime.Parse(item.Stime.ToString()).ToString("yyyy-MM-dd"); if (!list.Contains(date)) { list.Add(date); } } } //获取我的 常态化管控认领 情况 20200617 List <MydutyClaim_Info> myduties = _mydutyClaimInfo.GetByUid(vidModel.VID); myduties = myduties.Where(o => DateTime.Parse(o.EndDutyTime.ToString()).AddMinutes(15) >= DateTime.Now && o.status == "1").OrderBy(o => o.StartDutyTime).ToList(); foreach (var item in myduties) { MydutyClaimInfoMiddleModel mydutyClaimInfo = new MydutyClaimInfoMiddleModel(); SearchByIDAnduidModel searchByID = new SearchByIDAnduidModel(); searchByID.MydutyClaim_InfoID = item.id; searchByID.uid = item.Userid; MydutyClaim_Sign ii = _mydutyClaim_Sign.GetByParasOne(searchByID); if (ii != null && ii.id != null) { if (ii.type == "in") { item.status = "上传现场图片"; } if (ii.type == "img") { item.status = "待签退"; } if (ii.type == "out") { item.status = "已完结"; } } else { item.status = "待签到"; } //已经完结的 事项不再显示,只显示待办信息 20200622 if (item.status != "已完结") { string date = DateTime.Parse(item.StartDutyTime.ToString()).ToString("yyyy-MM-dd"); if (!list.Contains(date)) { list.Add(date); } } } return(list); }