예제 #1
0
        public ResponseContext <AskMomentDetailResponse> AskMomentDetail(Guid applyId, RequestHead head)
        {
            var response  = new ResponseContext <AskMomentDetailResponse>();
            var applyInfo = applyInfoDao.GetByApplyId(applyId);

            if (applyInfo == null)
            {
                return(response);
            }
            var myUserInfo = uerInfoBiz.GetUserInfoByUid(applyInfo.MomentUId);
            var userInfo   = uerInfoBiz.GetUserInfoByUid(applyInfo.UId);
            var moment     = MomentBuilder.GetMoment(applyInfo.MomentId);

            if (myUserInfo == null || userInfo == null || moment == null)
            {
                return(response);
            }
            response.Data = new AskMomentDetailResponse()
            {
                ApplyState     = applyInfo.ApplyState,
                ApplyStateDesc = ApplyStateMap(applyInfo.ApplyState),
                IsOverTime     = MomentContentBuilder.IsOverTime(moment.StopTime),
                MomentId       = moment.MomentId,
                ShareTitle     = MomentContentBuilder.GetShareTitle(moment),
                Address        = moment.Address,
                Latitude       = moment.Latitude,
                Longitude      = moment.Longitude,
                IsOffLine      = moment.IsOffLine,
                TextColor      = ApplyBuilder.TextColorMap(applyInfo.ApplyState),
                UserInfo       = UserInfoBuilder.BuildUserInfo(userInfo, head),
                BtnVisable     = applyInfo.ApplyState == ApplyStateEnum.申请中,
                ApplyList      = ApplyBuilder.GetApplyDetails(applyInfo.ApplyId, head, true)
            };
            return(response);
        }
예제 #2
0
        public ResponseContext <ApplyMomentListResponse> ApplyMomentList(RequestHead head)
        {
            var response = new ResponseContext <ApplyMomentListResponse>
            {
                Data = new ApplyMomentListResponse()
                {
                    MomentList = new List <ApplyMomentDetailType>()
                }
            };
            var applyList = applyInfoDao.GetListByUId(head.UId);

            if (applyList.IsNullOrEmpty())
            {
                return(response);
            }
            foreach (var apply in applyList)
            {
                var momentUserInfo = uerInfoBiz.GetUserInfoByUid(apply.MomentUId);
                var moment         = MomentBuilder.GetMoment(apply.MomentId);
                if (moment == null || momentUserInfo == null)
                {
                    continue;
                }

                var result = new ApplyMomentDetailType()
                {
                    ApplyId        = apply.ApplyId,
                    ApplyStateDesc = ApplyStateMap(apply.ApplyState),
                    TextColor      = ApplyBuilder.TextColorMap(apply.ApplyState),
                    ShareTitle     = MomentContentBuilder.GetShareTitle(moment),
                    MomentId       = moment.MomentId,
                    Address        = moment.Address,
                    Latitude       = moment.Latitude,
                    Longitude      = moment.Longitude,
                    IsOffLine      = moment.IsOffLine,
                    UserInfo       = UserInfoBuilder.BuildUserInfo(momentUserInfo, head),
                    ContentList    = MomentContentBuilder.BuilderContent2Contact(moment, momentUserInfo, apply.ApplyState == ApplyStateEnum.申请通过)
                };
                var applyDetaiList = applyDetailDao.GetListByApplyId(apply.ApplyId);
                if (applyDetaiList.NotEmpty())
                {
                    //最后一个对话信息
                    var applyDetail = applyDetaiList.OrderByDescending(a => a.CreateTime).First();
                    result.ApplyRemark = applyDetail.Content;
                }
                response.Data.MomentList.Add(result);
            }
            return(response);
        }
예제 #3
0
        public ResponseContext <ApplyMomentDetailResponse> ApplyMomentDetail(Guid applyId, RequestHead head)
        {
            var response  = new ResponseContext <ApplyMomentDetailResponse>();
            var applyInfo = applyInfoDao.GetByApplyId(applyId);

            if (applyInfo == null)
            {
                return(response);
            }
            var userInfo = uerInfoBiz.GetUserInfoByUid(applyInfo.MomentUId);
            var moment   = MomentBuilder.GetMoment(applyInfo.MomentId);

            if (userInfo == null || moment == null)
            {
                return(response);
            }
            string btnText = ApplyBuilder.BtnTextMap(applyInfo.ApplyState);

            response.Data = new ApplyMomentDetailResponse()
            {
                ApplyState     = applyInfo.ApplyState,
                ApplyStateDesc = ApplyStateMap(applyInfo.ApplyState),
                MomentId       = moment.MomentId,
                ShareTitle     = MomentContentBuilder.GetShareTitle(moment),
                BtnText        = btnText,
                Address        = moment.Address,
                Latitude       = moment.Latitude,
                Longitude      = moment.Longitude,
                IsOffLine      = moment.IsOffLine,
                NextAction     = ApplyBuilder.BtnActionMap(applyInfo.ApplyState),
                BtnVisable     = !string.IsNullOrEmpty(btnText),
                TextColor      = ApplyBuilder.TextColorMap(applyInfo.ApplyState),
                UserInfo       = UserInfoBuilder.BuildUserInfo(userInfo, head),
                ContentList    = MomentContentBuilder.BuilderContent2Contact(moment, userInfo, applyInfo.ApplyState == ApplyStateEnum.申请通过),
                ApplyList      = ApplyBuilder.GetApplyDetails(applyInfo.ApplyId, head, false)
            };
            return(response);
        }