using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL; using CY.BLL.Sys; using CY.Model; using CY.Infrastructure.Query; using CY.Infrastructure.Common; using CY.BLL.EC; using CY.Model.Inquiry; namespace CY.WebForm.Pages.business { //吴辉 //行政管理 public partial class DeliverWorkBookAnPaiDetailsongdao : BasePage { CoreCmsPlanOrderBLL _CoreCmsPlanOrderBLL = null; CoreCmsPlanOrderItemBLL _CoreCmsPlanOrderItemBLL = null; OA_StaffBLL bll_OA_StaffBLL = null; OA_CarManageBll _OA_CarManageBll = null; CoreDeliverOrderBLL _CoreDeliverOrderBLL = null; CoreDeliverOrderItemBLL _CoreDeliverOrderItemBLL = null; public string biaotou = ""; public string biaowei = ""; //初始化 public DeliverWorkBookAnPaiDetailsongdao() { _CoreCmsPlanOrderBLL = new CoreCmsPlanOrderBLL(); bll_OA_StaffBLL = new OA_StaffBLL(); _OA_CarManageBll = new OA_CarManageBll(); _CoreDeliverOrderBLL = new CoreDeliverOrderBLL(); _CoreDeliverOrderItemBLL = new CoreDeliverOrderItemBLL(); _CoreCmsPlanOrderItemBLL = new CoreCmsPlanOrderItemBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindList(); } } //绑定数据 private void BindList() { string orderIdStr = Request["orderId"]; var coreDeliverOrder = _CoreDeliverOrderBLL.GetModelByKeyid(orderIdStr); var coreCmsPlanOrder = _CoreCmsPlanOrderBLL.GetModelByKeyid(coreDeliverOrder.OrderId.Value); var cmsPlanOrderItems = _CoreCmsPlanOrderItemBLL.GetModelsByOrderid(coreDeliverOrder.OrderId.Value); var coreDeliverOrderItems = _CoreDeliverOrderItemBLL.GetModelsByOrderid(orderIdStr); //已经送货数量 var coreDeliverOrderItemssssss = _CoreCmsPlanOrderItemBLL.GetDeliverModelsByplanOrderids(coreCmsPlanOrder.orderkeyid.Value).Where(x=>x.PlanOrderId == coreCmsPlanOrder.id ).Where(x => x.OrderState == 2).OrderByDescending(x=>x.MakeTime); var coreDeliverOrderItemssonghuo = coreDeliverOrderItemssssss.Where(x => x.OrderState == 2); //送货数量统计 var coreDeliverOrderItemsgroup = coreDeliverOrderItemssonghuo.GroupBy(p => new { p.ZYBName, p.ZYBSpecification }) // 多个字段作为匿名类型分组键 .Select(g => new CoreDeliverOrderItem { // 分组字段 ZYBName = g.Key.ZYBName, ZYBSpecification = g.Key.ZYBSpecification, // 统计结果 //Count = g.Count(), // 每组人数 //AverageSalary = g.Average(p => p.Salary), // 平均工资 Number = g.Sum(p => p.Number), // 工资总和 LessNumber = g.Sum(p => p.LessNumber) }).ToList(); this.spanpianqu.InnerText = coreCmsPlanOrder.pianqu; this.spanxuexiao.InnerText = coreCmsPlanOrder.shipAddress; this.spanDizhi.InnerText = coreCmsPlanOrder.shouhuoAddress; this.spanLianxiren.InnerText = coreCmsPlanOrder.shipName; this.spanDianhua.InnerText = coreCmsPlanOrder.shipMobile; this.spanShijian.InnerText = coreDeliverOrder.MakeTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); this.spanZhuangtai.InnerText = coreDeliverOrder.OrderStateName; //送货数量统计 var coreDeliverOrderItemssssssgroup = coreDeliverOrderItemssssss.GroupBy(p => new {p.MakeTime }) // 多个字段作为匿名类型分组键 .Select(g => new CoreDeliverOrderItem { // 分组字段 MakeTime = g.Key.MakeTime }).OrderByDescending(x=>x.MakeTime).ToList(); string biaotou2 = ""; foreach (var coreDeliverOrderItem1 in coreDeliverOrderItemssssssgroup) { biaotou += "