예제 #1
0
        public ActionResult ExpressInfoExport(ExpressInfoRefer refer)
        {
            refer.PageIndex = 1;
            refer.PageSize  = int.MaxValue;
            var result = ExpressClient.Instance.QueryExpressInfoPageList(refer);

            if (result.List == null || !result.List.Any())
            {
                return(View("Error"));
            }
            var dicProperties = new Dictionary <string, string>();

            dicProperties.Add("SysNo", "SysNo");
            dicProperties.Add("OrderCode", "订单号");
            dicProperties.Add("LogiscticNo", "物流单号");
            dicProperties.Add("LogiscticId", "配送商ID");
            dicProperties.Add("LogiscticCompanyName", "快递公司");
            dicProperties.Add("OrderStatusContent", "订单扭转");
            dicProperties.Add("LogiscticContent", "物流信息");
            dicProperties.Add("LogisticOuterContent", "国际物流");
            dicProperties.Add("CallTypeDesc", "对接方式");
            dicProperties.Add("SubscribeStatusDesc", "订阅状态");
            dicProperties.Add("SubscribeCount", "订阅次数");
            dicProperties.Add("CallCount", "总调用(推送)次数");
            dicProperties.Add("LastStatusDesc", "运单状态");
            dicProperties.Add("PushRequestMessage", "快递100消息");
            dicProperties.Add("RequestFaildReason", "订阅失败原因");
            dicProperties.Add("OrderTypeDesc", "订单类型");
            dicProperties.Add("RowCreateDate", "创建日期");
            dicProperties.Add("Remark", "备注");
            dicProperties.Add("HandleSuggest", "处理建议");

            ExcelHelper.GetInstance().WriteListToExcel(result.List, dicProperties, "物流信息列表");
            return(null);
        }
예제 #2
0
        //[NoResubmit]
        public ActionResult Index(ExpressInfoRefer refer)
        {
            if (refer.Search.BeginTime == null)
            {
                refer.Search.BeginTime = DateTime.Now.AddMonths(-1).Date;
            }
            if (refer.Search.EndTime == null)
            {
                refer.Search.EndTime = DateTime.Now.Date;
            }
            var orderType = refer.Search.OrderType;

            ViewBag.OrderType = orderType;
            refer.PageSize    = 30;
            var result = ExpressClient.Instance.QueryExpressInfoPageList(refer);

            ViewBag.Total = result.Total;
            return(View(result));
        }
예제 #3
0
        //查询列表
        public ExpressInfoRefer QueryExpressInfoPageList(ExpressInfoRefer refer)
        {
            var ret    = new ExpressInfoRefer();
            var search = ret.Search = refer.Search;

            try
            {
                var req = Mapper.Map <ExpressInfoSearchModel, EC_QueryExpressInfoList>(search);
                req.PageIndex = refer.PageIndex;
                req.PageSize  = refer.PageSize;
                var response = BSClient.Send <EC_QueryExpressInfoListResponse>(req);
                if (response.DoFlag && response.Dtos != null && response.Dtos.Any())
                {
                    var expressOrderTypeArr  = typeof(AppEnum.ExpressOrderTypeEnum).GetEnumList();
                    var expressCallTypeArr   = typeof(AppEnum.ExpressCallTypeModeEnum).GetEnumList();
                    var expressLastStatusArr = typeof(AppEnum.ExpressLastStatusEnum).GetEnumList();
                    var subscribeStatusArr   = typeof(AppEnum.ExpressSubscribeStatusEnum).GetEnumList();
                    ret.List = Mapper.MappGereric <EC_QueryExpressInfoListDto, ExpressInfoModelExt>(response.Dtos);

                    for (var i = 0; i < ret.List.Count(); i++)
                    {
                        var item             = ret.List[i];
                        var logisContent     = item.LogiscticContent;
                        var orderStatus      = item.OrderStatusContent;
                        var orderStatusShow  = item.OrderStatusContent;
                        var outerContent     = item.LogisticOuterContent;
                        var outerContentShow = item.LogisticOuterContent;
                        if (!string.IsNullOrEmpty(orderStatus) && orderStatus.Length > 40)
                        {
                            orderStatus     = orderStatus.Substring(0, 40) + "...";
                            orderStatusShow = item.OrderStatusContent;
                        }
                        if (!string.IsNullOrEmpty(logisContent) && logisContent.Length > 40)
                        {
                            logisContent = item.LogiscticContent.Substring(0, 40) + "...";
                        }
                        if (!string.IsNullOrEmpty(outerContent) && outerContent.Length > 40)
                        {
                            outerContent     = item.LogisticOuterContent.Substring(0, 40) + "...";
                            outerContentShow = item.LogisticOuterContent;
                        }
                        ret.List[i].OrderStatusContentShow    = orderStatus;
                        ret.List[i].OrderStatusContentTitle   = orderStatusShow;
                        ret.List[i].LogiscticContentShow      = logisContent;
                        ret.List[i].LogiscticContentTitle     = Converter.ConvertExpressContent(item.LogiscticContent);
                        ret.List[i].LogisticOuterContentShow  = outerContent;
                        ret.List[i].LogisticOuterContentTitle = outerContentShow;

                        if (expressLastStatusArr.Any(c => c.Key == item.LastStatus))
                        {
                            ret.List[i].LastStatusDesc = expressLastStatusArr.First(c => c.Key == item.LastStatus).Value;
                        }
                        else
                        {
                            ret.List[i].LastStatusDesc = "空";
                        }
                        ret.List[i].OrderTypeDesc      = expressOrderTypeArr.First(c => c.Key == item.OrderType).Value;
                        ret.List[i].PushRequestMessage = "";
                        if (!string.IsNullOrEmpty(item.PushRequestMessage))
                        {
                            ret.List[i].PushRequestMessage = item.PushRequestMessage;
                        }
                        ret.List[i].CallTypeDesc        = expressCallTypeArr.First(c => c.Key == item.CallType).Value;
                        ret.List[i].SubscribeStatusDesc = subscribeStatusArr.First(c => c.Key == item.SubscribeStatus).Value;
                    }

                    ret.PageIndex = response.PageIndex;
                    ret.PageSize  = response.PageSize;
                    ret.Total     = response.Total;
                }
            }
            catch (Exception e)
            {
                ret.DoResult = "导出异常或数据量太大,请筛选条件后再导出0.0:" + e.Message;
            }
            return(ret);
        }