Пример #1
0
        /// <summary>
        /// 得到反馈信息(查询)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <FeedbackResultDTO> GetFeedbackList(FeedbackSearchDTO dto)
        {
            List <FeedbackResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_FeedbackStat.AsNoTracking().Where(p => p.FeedbackStatID != null);

            {
                if (!string.IsNullOrEmpty(dto.FeedbackSystem))
                {
                    pp = pp.Where(p => p.FeedbackSystem == dto.FeedbackSystem);
                }
                if (!string.IsNullOrEmpty(dto.SearchText))
                {
                    pp = pp.Where(p => p.master_UserInfo.master_DistributorInfo.Any(m => m.DistributorName.Contains(dto.SearchText)) ||
                                  p.master_UserInfo.FullName.Contains(dto.SearchText));
                }
            }
            dto.Count = pp.Count();
            pp        = pp.OrderBy(m => m.FeedbackStaus).ThenByDescending(m => m.FeedbackDate).ThenBy(m => m.FeedbackStatID).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <master_FeedbackStat>, List <FeedbackResultDTO> >(pp.ToList());

            return(result);
        }
Пример #2
0
        public HttpResponseMessage GetFeedbackList(string FeedbackSearchDTO)
        {
            FeedbackSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <FeedbackSearchDTO>(FeedbackSearchDTO);
            ResultDTO <List <FeedbackResultDTO> > actionresult = new ResultDTO <List <FeedbackResultDTO> >();

            try
            {
                actionresult.Object       = _ICommonServices.GetFeedbackList(dto);
                actionresult.SubmitResult = true;
                actionresult.rows         = dto.rows;
                actionresult.page         = dto.page;
                actionresult.Count        = dto.Count;
            }
            catch (Exception ex)
            {
                actionresult.SubmitResult = false;
                actionresult.Message      = ex.Message;
            }
            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(actionresult),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
Пример #3
0
        /// <summary>
        /// 得到反馈管理
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultData <List <FeedbackModel> > GetFeedbackList(FeedbackSearchDTO dto)
        {
            ResultData <List <FeedbackModel> > result = null;

            result = GetAPI <ResultData <List <FeedbackModel> > >(WebConfiger.MasterDataServicesUrl + "Feedback?FeedbackSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto));

            return(result);
        }
Пример #4
0
        /// <summary>
        /// 得到反馈信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetFeedbackList(FeedbackSearchDTO dto)
        {
            ResultData <List <FeedbackModel> > result = new ResultData <List <FeedbackModel> >();

            result = SystemProvider.GetFeedbackList(dto);

            return(Json(new { total = result.Count, rows = result.Object }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public List <FeedbackSearchResultDTO> SearchFeedbacks(FeedbackSearchDTO searchFeedBacks, int storeID, long userID, out bool HasMoreRows)
        {
            FeedbackSearch objFeedback = new FeedbackSearch();

            ObjectMapper.Map(searchFeedBacks, objFeedback);

            List <FeedbackSearchResultDTO> searchresult = new List <FeedbackSearchResultDTO>();

            ObjectMapper.Map(FeedbackRepository.SearchFeedbacks(objFeedback, storeID, userID, out HasMoreRows), searchresult);
            return(searchresult);
        }
Пример #6
0
        /// <summary>
        /// 导出反馈
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult ExportFeedback(FeedbackSearchDTO dto)
        {
            dto.page = 1;
            dto.rows = 10000000;
            List <FeedbackModel> resultFeedback = null;
            string result = null;

            resultFeedback = SystemProvider.GetFeedbackList(dto).Object;

            string        strTemplateFile = Server.MapPath(@"~/TempLate/FeedbackTemplate.xlsx");
            string        strGenarateDir  = Server.MapPath(@"~/TempFile");
            string        strGenarateFile = Guid.NewGuid().ToString("N") + ".xlsx";
            string        strExportFile   = strGenarateDir + "\\" + strGenarateFile;
            List <object> ratelist        = new List <object>();

            resultFeedback.ForEach(g =>
            {
                Models.Model.Excel.ExcelFeedback er = new Models.Model.Excel.ExcelFeedback();
                er.状态 = g.FeedbackStausStr;
                if (g.AttachFile != null)
                {
                    er.附件 = g.AttachFile.AttachFileSrcName + g.AttachFileExtentionName;
                }
                er.反馈日期  = g.FeedbackDate.ToString();
                er.反馈人   = g.FullName;
                er.反馈系统  = g.FeedbackSystem;
                er.反馈模块  = g.FeedbackModel;
                er.反馈内容  = g.FeedbackContent;
                er.经销商   = g.UserDistributorstr;
                er.部门    = g.DepartName;
                er.反馈人手机 = g.PhoneNumber;
                er.反馈人邮箱 = g.Email;
                ratelist.Add(er);
            });

            if (Common.ExcelHelper.Export(strTemplateFile, strGenarateDir, strGenarateFile, ratelist, "Sheet1"))
            {
                result = strGenarateFile;
            }

            return(Json(result));
        }
Пример #7
0
        public void TestMethod1()
        {
            //查询反馈
            FeedbackSearchDTO dto = new FeedbackSearchDTO();

            dto.page = 1;
            dto.rows = 1;
            List <FeedbackResultDTO> list = _ICommonServices.GetFeedbackList(dto);
            //新增反馈
            FeedbackOperateDTO dto1 = new FeedbackOperateDTO();

            dto1.UserID          = 1;
            dto1.FeedbackSystem  = "基础数据";
            dto1.FeedbackModel   = "区域管理";
            dto1.FeedbackStaus   = 0;
            dto1.FeedbackDate    = DateTime.Now;
            dto1.FeedbackContent = "测试";
            int bl = _ICommonServices.AddFeedback(dto1);

            Assert.AreNotEqual(bl, -1);

            //查询反馈
            FeedbackSearchDTO dto2 = new FeedbackSearchDTO();

            dto2.page = 1;
            dto2.rows = 1;
            List <FeedbackResultDTO> list1 = _ICommonServices.GetFeedbackList(dto2);
            //修改状态
            FeedbackOperateDTO dto3 = new FeedbackOperateDTO();

            dto3.FeedbackStatID = (list1[0]).FeedbackStatID;
            dto3.FeedbackStaus  = 1;
            dto3.DealUser       = "******";
            dto3.DealDatetime   = DateTime.Now;
            bool bl1 = _ICommonServices.UpdateFeedback(dto3);

            Assert.IsTrue(bl1);
        }
Пример #8
0
        public JsonResponse <FeedbackSearchResultOutputDTO> SearchFeedbacks(FeedbackSearchDTO searchFeedBacks, int storeID, long userID)
        {
            JsonResponse <FeedbackSearchResultOutputDTO> response = new JsonResponse <FeedbackSearchResultOutputDTO>();

            try
            {
                ExceptionEngine.AppExceptionManager.Process(() =>
                {
                    bool HasMoreRows = false;
                    FeedbackSearchResultOutputDTO output = new FeedbackSearchResultOutputDTO();
                    output.FeedbacksearchList            = FeedbackBusinessInstance.SearchFeedbacks(searchFeedBacks, storeID, userID, out HasMoreRows);

                    FeedbackCountSearchDTO inputStatuCount = new FeedbackCountSearchDTO()
                    {
                        FeedbackCatIDs  = searchFeedBacks.FeedbackCatIDs,
                        FeedbackTeamIDs = searchFeedBacks.FeedbackTeamIDs,
                        FeedbackTypeIDs = searchFeedBacks.FeedbackTypeIDs
                    };
                    List <SearchFeedbackStatusCountDTO> FeedbackStatusCountList = FeedbackBusinessInstance.SearchFeedbackStatusCount(inputStatuCount, userID, 0);
                    StringBuilder data = new StringBuilder();;
                    FeedbackStatusCountList.ForEach(k => data.Append(k.FeedbackStatusName.Trim() + " (" + k.FeedbackCount + "),"));
                    //string ss= string.Join("," FeedbackStatusCountList.Select(k=>new { Status=k.FeedbackStatusName+" ("+k.FeedbackCount+")"}).ToArray() );
                    // output.SearchFeedbackStatusCountList = FeedbackBusinessInstance.SearchFeedbackStatusCount(inputStatuCount, userID, 0);
                    output.StatusCountStr = data.ToString().TrimEnd(',');
                    output.HasMoreRows    = HasMoreRows;
                    response.SingleResult = output;

                    response.IsSuccess = true;
                }, AspectEnums.ExceptionPolicyName.ServiceExceptionPolicy.ToString());
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
            }
            return(response);
        }